Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Color3 values seem to set ImageColor3 to 255,255,255 but visually it's 0,0,0?

Asked by 3 years ago

So I have 2 lines of code;

local preset1 = script.Parent.preset1
preset1.Preview.ImageColor3 = Color3.fromRGB(preset1.Colour.Value)

This is simple, you'd expect it to work but instead it doesn't, instead of functioning properly it doesn't change the colour if I check the value but visually, it's just pitch black. I don't get any errors whatsoever and I'm 100% sure I'm doing the right thing, what's going on?

0
When using Color3.fromRGB() it expects 3 values, red value, green value, and blue value.Your only giving it one, I guess since its only recieving one its turning pitch black.I dont really know. Phase_Venom 55 — 3y
0
Can you please tell me what preset1.Colour.Value is? rabbi99 714 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

If preset1.Color.Value is a Color3Value then you dont need to use Color3.fromRGB

Ad
Log in to vote
0
Answered by
TGazza 1336 Moderation Voter
3 years ago

try

Color3.fromRGB Example:

local preset1 = script.Parent.preset1.Colour.Value
local R = preset1.R
local G = preset1.G
local B = preset1.B
preset1.Preview.ImageColor3 = Color3.fromRGB(R,G,B)

Normal Color3.new Example:

local preset1 = script.Parent.preset1.Colour.Value
local R = preset1.R/255
local G = preset1.G/255
local B = preset1.B/255
preset1.Preview.ImageColor3 = Color3.new(R,G,B)

Answer this question