I’m trying to put a color3value in a table
But the color keeps going black.
The code:
v is the text button, and I’m trying to store the background color of v into the table
sendData[6] = Color3.fromRGB(v.BackgroundColor3)
print(sendData[6])
I’m trying to put a color3value in a table
But the color keeps going black.
The code:
v is the text button, and I’m trying to store the background color of v into the table
sendData[6] = Color3.fromRGB(v.BackgroundColor3)
print(sendData[6])
The Color3.fromRGB(v.BackgroundColor3)
is invalid, because it’s basically returning “Color3.fromRGB(Color3.new(R,G,B))
”.
Try replacing it with: sendData[6] = v.BackgroundColor3
Hope this helps
The console is printing a color3.new value which is between 0,0,0 and 1,1,1, how do I make it an RGB?
0.278431, 0.137255, 0
sendData[6] = v.BackgroundColor3
print(sendData[6])
Also when firing the table to the server the server says the color is nil
Just multiply the R, G, & B values by 255. (and floor them using math.floor
if needed)
local R = v.BackgroundColor3.R * 255
local G = v.BackgroundColor3.G * 255
local B = v.BackgroundColor3.B * 255
print(Color3.fromRGB(R,G,B))
sendData[6] = Color3.new(v.BackgroundColor3)
print(sendData[6])
This prints (0,0,0)
And
This prints
0.745098, 0.407843, 0.384314
I am so sorry, I forgot to mention this: If a Color3 is not equal to an integer, it will equal what it equals, basically suggesting the Color3 needs to be an integer to print it as an integer.
I don’t get what that means so what do I need to change?
Note: Color3’s will always print in decimal form even if you print the fromRGB version. IF you need it print the 0-255 version, use Vector3 instead.
Nothing, the color should work, it just wont look like: 0,0,0. It won’t be an integer, but should work.
Vector3?
So I do: Vector3.new(sendData[7]) ?
Isn’t Vector3
used for positions and not colors?
Vector3 is the position/size of objects, not colors.
There are 3 values in a Color3 and Vector3. Which means you can store information for the same color value in either type. However you will need to convert the Vector3 into a fromRGB to use it.
However I do not recommend using Vector3 at all since you can just multiply a Color3.new by 255 to make a Color3.fromRGB. I only mentioned Vector3 for storing a Color3.fromRGB value for readability purposes (because it will print as if it was Color3.new
Does the Color3 code you got from before work? If so, then there’s no point in trying to get it to be an integer, because it can’t become one.
Oh wait, i just tested it out and it actually works for some reason. Never thought it would actually work
what, how?? that makes no sense!
Just know that if you want to apply that back into the part, you need to do:
Color3.fromRGB(Vector3.X, Vector3.Y, Vector3.Z) and not R,G,B because Vector3 doesn’t have R,G,B.
nope , it doesnt work
efegrgge