Color3Value

Hold a colour in the tree, for a theme or a setting your program reads.

Value is a Color3, black by default, and takes only a Color3. Each change fires Changed with the new colour.

Made with Instance.new("Color3Value") or Clone().

Example

Read and copy a colourShotScript
-- A Color3Value holds a colour, each channel from 0 to 1. Settings.Tint is one, saved as Color3(1, 0.5, 0).
local tint = root.Settings.Tint
print(string.format("Tint: R %.1f, G %.1f, B %.1f", tint.Value.R, tint.Value.G, tint.Value.B))

local copy = Instance.new("Color3Value")
print(string.format("a new Color3Value: R %.1f, G %.1f, B %.1f", copy.Value.R, copy.Value.G, copy.Value.B))
copy.Changed:Connect(function(colour : Color3)
	print("the copy changed, the same colour as Tint: " .. tostring(colour == tint.Value))
end)
copy.Value = tint.Value
What it printedOutput
Tint: R 1.0, G 0.5, B 0.0
a new Color3Value: R 0.0, G 0.0, B 0.0
the copy changed, the same colour as Tint: true

Properties

NameTypeDefaultDescription
ValueColor3"Color3 0, 0, 0"The colour it holds; each change fires Changed with the new colour, and anything but a Color3 errors.
From ShotInstance 33