Tutorial:Using Color3

This tutorial goes over the usage of the Color3 data type. There are three ways to do it.

RGB
RGB is an additive colour model. The colours red, green, and blue mix together to form a composite colour. RGB uses three values, one for each colour. All numbers are between 0 and 1, with higher numbers being lighter. So, (0,0,0) would be pitch-black, while (1,1,1) would be completely white. (1,0,0) would make a scarlet colour, (0,1,0) would make lime green, and (0,0,1) would make an electric blue. If all values are the same, the colour will make some shade of grey, again, with higher numbers making lighter shades.

So, (0.1,0.1,0.1) would make a dark grey while (0.9,0.9,0.9) would make a lighter grey.

To make a script that changes the colour of a part, simply enter the following code. Note that the script MUST be the child of the part.

.fromRGB
Another way to enter RGB values is by entering "fromRGB" instead of "new." Only this time, the values will range from 0 to 255, with (0,0,0) being black and (255, 255, 255) being white. The code is below.

.fromHSV
HSV is an alternative to RGB. Instead of using red, green and blue, values, HSV stands for hue, saturation and value. These are all very new terms, so I will explain them here.

Hue
Hue is the actual colour used. We will use this colour wheel to right. You can see that it takes a full circle, starting at red, or 0°. The arrow moves in a counterclockwise direction, ending back at red, or 360°. Normally, to find the colour value, you would find the counterclockwise angle between 0° and the colour on the wheel.

So, red is at 0°. Aqua is at 180°. Indigo is at about 120°. Lime green is at about 240°.

However, instead of using numbers from 0 to 360°, the Roblox system only takes values from 0 to 1. So, you would give a decimal/fraction of the whole circle.

So, red is at 0, aqua is at 0.5, Indigo is at 1/3, and lime green is at 2/3.

Saturation
Saturation, also known as chroma, refers to how much colour is in the shade. So, 1 would give the colours in the wheel, while 0 would make a black-and-white colour.

Value
Value, also known as lightness, refers to how much light is in the colour. A lightness value of 0 would black, regardless of what the other values are, because black is the complete absence of light. 1 would make white regardless of what the other values are because white is a combination of all the possible wavelengths of light.

To script an HSV colour, type the following into your script: