While making a script that changes a GUI's text to a part's Color3
values using Color.R
(3 separate text boxes), I noticed that it divided the number by 255 before displaying the value. I'm not sure why it does this but I also don't know how to fix it. I tried multiplying the value by 255 to get a more accurate value, but the value did not change at all. I'm not quite sure what I'm doing wrong. Here's a snippet of code that is supposed to fix the issue, that doesn't change it at all. The text isn't edited anywhere else inside the script, so I'm not quite sure what to do about it.
GrassRValue.Text = game.Workspace.Grass.Color.R * 255 GrassGValue.Text = game.Workspace.Grass.Color.G * 255 GrassBValue.Text = game.Workspace.Grass.Color.B * 255
Your script makes a mistake.
game.Workspace.Grass.Color
Color is not a valid member of 'Grass'. You can try to make that the 'BrickColor.Color3' instead of using 'Color',
Have a nice day and happy coding :) If you have any question, comment below :D
Well here is a thing..
a value RGB goes from 0 to 255, anything below or over 255 is invalid RGB value.. therefore, doing 255*X with X being a number that's not 1 will return an invalid value..
whenever you enter an invalid RGB value, Roblox doesn't raise an error..
here is an example of how to make colors with RGB
red,(no green,no blue) => RGB(255,0,0)
(no red), green, (no blue) => RGB(0,255,0)
(no red,no green), blue => RGB(0,0,255)
NOTE: these color examples might not be 100% accurate.
to access an RGB value of a brick in roblox, you do -
print(brick.Color3)
by combining different amount of red,green and blue we can make any color..
GOOD luck