Color3Value

Show Deprecated

A container object for a single Color3 value.

Code Samples

Set Color3Value

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

Summary

Properties

The stored Color3.

Events


Fired whenever the Color3Value.Value is changed.

Methods

Properties

Value

Events

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.

Parameters

value: Color3

The new value after the change.


Code Samples

How to Use Color3Value.Changed

1local value = Instance.new("Color3Value")
2value.Parent = workspace
3
4value.Changed:Connect(function(NewValue)
5 print(NewValue)
6end)
7
8value.Value = Color3.fromRGB(50, 50, 50)

Methods