Example:
if Color3.new(255/255,255/255,255/255) >= Color3.new(255/244,255/244,255/244) then
print("Woah!")
end
I get an error saying:
attempt to compare two userdata values
Example:
if Color3.new(255/255,255/255,255/255) >= Color3.new(255/244,255/244,255/244) then
print("Woah!")
end
I get an error saying:
attempt to compare two userdata values
Convert them to vectors then compare their magnitude.
local c1, c2 = Color3.new(1,1,1), Color3.fromRGB(244,244,244)
if Vector3.new(c1.r,c1.g,c1.b).magnitude >= Vector3.new(c2.r,c2.g,c2.b).magnitude then
print("Woah!")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
In what way do you want to compare them?
Do you want to know which one is "brighter"? If so, what kind of "brightness" do you need? Is light gray brighter than pure red? etc?
Also: you can use Color3.fromRGB(255, 255, 255) instead of manually dividing by 255 with Color3.new