I want to convert Color3.new to Color3.fromRGB (I’m more comfortable with fromRGB). I was able to get the right method of converting with some help, but Studio still reads it as a Color3.new.
My code:
local toAdd = Color3.new(0, 0, 0)
for i, v in pairs(color.Keypoints) do
toAdd = Color3.new(toAdd.R+v.Value.R, toAdd.G+v.Value.G, toAdd.B+v.Value.B)
end
local r = ((toAdd.R*255)/#color.Keypoints)
local g = ((toAdd.G*255)/#color.Keypoints)
local b = ((toAdd.R*255)/#color.Keypoints)
print(r, g, b, "Expected output") --Expected output
local returnThis = Color3.fromRGB(r,g,b)
print(returnThis.R, returnThis.G, returnThis.B, "Returned") --What is given
Output:
11:54:48.571 | 205.06323158741 144.5982465148 205.06323158741 Expected output - Client - MainModule:46
11:54:48.571 | 0.8041695356369 0.56705194711685 0.8041695356369 Returned - Client - MainModule:48