Color3Value

Visualizza obsoleti

A container object for a single Color3 value.

Campioni di codice

Set Color3Value

local myColor3Value = script.Parent
myColor3Value.Value = Color3.new(1, 0, 0) -- Red
-- You can also store the color of a BrickColor value by accessing BrickColor's Color property, which is a Color3:
local someBrickColor = BrickColor.new("Really red")
myColor3Value.Value = someBrickColor.Color

Proprietà

Value

lettura parallela

The stored Color3.

Metodi

Eventi

Changed

Fired whenever the Color3Value.Value of the Color3Value is changed. It will run with the new value being stored in the argument object, instead of a string representing the property being changed.

This event, like other changed events, can be used to track when an Color3Value changes and to track the different values that it may change to.

For instance, this may be useful in games that rely on Color3Values to track values such as colors for games using customizable outfits or items.

Equivalent changed events exist for similar objects, such as NumberValue and StringValue, depending on what object type best suits the need.

Parametri

value: Color3

The new value after the change.


Campioni di codice

How to Use Color3Value.Changed

local value = Instance.new("Color3Value")
value.Parent = workspace
value.Changed:Connect(function(NewValue)
print(NewValue)
end)
value.Value = Color3.fromRGB(50, 50, 50)