I'm doing this script, but my TextLabel's color is in RGB values [0,0,255], etc.., but the color I'm passing in is in letters(BrickColor), will the script work? Or do I need to convert the BrickColor to RGB values? If so, how would I go about doing this?
Thank you!
Since all possible values for the property BackgroundColor3
must be
Color3 values or values of similar nature, you would have to convert
the BrickColor
value into a readable Color3
value.
myBrickColor = BrickColor.new('Royal purple') myColor3 = myBrickColor.Color
You would have to divide all arguments by 255 in order to get the proper or desired color, because all Color3 values are meant to be ranged from 0 - 1.
function Color(red, green, blue) return Color3.new(red/255, green/255, blue/255) end
idk if its possible with letters, but I always just do (G/255,R/255,B/255) Example: (2/255, 19/255, 78/255)
BackgroundColor3 is a Color3 value, all things in guis that involve colors are color3 values. Example of creating a color3 value
local color = Color3.new(255/255, 122/255, 25/255)
You have to add /255 to each value or have the value between 0 and 1. 1 would == 255/255. and 0 would be 0/255.
If you wanted to get the color of a BrickColor you can do BrickColor.new("Bright blue").Color
EDIT: Color3(red, green, blue) (R G B)