(15, 124, 7)--- this is supposed to be the color of green selectionbox i tested it on a brick with selectionbox, but whenever i use that color it just gives me white
selectionBox = Instance.new("SelectionBox") selectionBox.Adornee = mouse.Target.Parent selectionBox.Color3 = Color3.new(15, 124, 7)
selectionBox.Parent = camera
There are multiple ways to create Color3 values:
Color3.new(r, g, b)
, which expects three arguments that represent the red, green and blue components of the color respectively. Color3.new
expects these values to be in the range 0
through 1
; in other words, a percentage.
Color3.fromRGB(r, g, b)
, which is an alternative way of creating colors from their RGB values, except this function expects them in the range 0
through 255
. This is most likely the one you want to use.
Color3.fromHSV(h, s, v)
is a totally different way of creating a Color3. It expects three arguments which correspond to the hue, saturation and value of the color. The hue is the pure color (red, blue, green, yellow, purple, etc.), the saturation is the "colorness" (dull to fully colored) and the value is the brightness (black to white) of the color.
Finally, It is also possible to get the Color
component of a BrickColor value:
local selectionBox = Instance.new("SelectionBox") selectionBox.Color3 = BrickColor.new("Bright green").Color
Hope this helped. :)
The Color3.new function takes in 3 numbers.
Red component
Green component
Blue component
But i'm sure you already knew that. What you probably didn't know is that the monitor has a color gamut. The Color3.new function interprets the color gamut as numbers out of 255. Your arguments have to be numbers out of 255.
255/255 is the highest value, so anything higher(like 15, 124, or 7) will default to 1. This is why your SelectionBox kept getting turning white :)
selectionBox.Color3 = Color3.new(15/255, 124/255, 7/255)
There are 3 ways to make Color3 values.
Color3 takes 3 values, R,G,B, wich are Red, Green and Blue, but i assume you got that part.
The way's to make Color3's are simple:
BrickColor
to Color3
conversion, Color3.new()
and Color3.fromRGB()
How do we use those?
BrickColor to Color3
BrickColor to Color3 is done by putting in a brickColor and adding .Color
after it:
BrickColor.new("ColorName").Color
--> Will return the Color3 from the brickColor wich you can instantly use on anything.
(For all brick colors, look here )
Color3.fromRGB()
Color3.fromRGB()
will allows you to insert values from 0 to 255 instead of deviding everything by 255. (If you didn't know, 255 is the max value for Color3.)
Color3.fromRGB(15, 124, 7)
--> will make your thingy the color you want
Color3.new
Color3.new()
will require you to insert values from 0 to 1. 0 will refer to 0, 1 will refer to 255
Color3.new(0, 1, 0)
--> will make something lime green.