Jump to content

compare car colors


JeViCo

Recommended Posts

Posted (edited)

Hello everyone! How can i compare 2 different rgb car colors? I can't compare just doing (r,g,b) ~= (r2,g2,b2)

Edited by Juuve
  • Moderators
Posted
if r ~= r2 or g ~= g2 or  b ~= b2 then
	-- not the same color
end

 

  • Thanks 1

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

You can only check for red cause if one of the 3 is different the color will be different.

if r ~= r2 then

--not the same collor

end

No need to check all 3 of 'em. :)

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

  • Moderators
Posted (edited)

You can only check for red cause if one of the 3 is different the color will be different.

No need to check all 3 of 'em. :)

I do not agree with that.

Colour 1: 255, 100, 50

Colour 2: 255, 70, 50 <-

Edited by IIYAMA

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...