#Color from image does for some reason does not equal the same color on an image

1 messages · Page 1 of 1 (latest)

spiral drum
#

Please help, my color comparing for both my level generator and my shader break when i change the sprite to the exact same sprite (without touching the .meta files) They are the exact same color yet for some reason a_color != a_color and i have absolutly no idea what is wrong please help

spiral drum
#

pls

thick umbra
#

How do you know they are exactly the same value?

#

And are you comparing like this: someColor != otherColor?

spiral drum
#

.Equals()

#

i think

#

lettme check

#

My pc ran out of space so i had to reboot lol

thick umbra
#

Hmm. It might be inaccurate because of floating point errors. What if you compare each float component with Mathf.Approximately, or some other more forgiving way of checking

#

like Mathf.Abs(colorA.r - colorB.r) < 0.001f

spiral drum
#

colorMappingsBlocks.color.Equals(pixelColor)

#

this is the exact code

thick umbra
#

yeah, try comparing them with the methods I suggested above

spiral drum
#

k. I'm also having the same issue with shadergraph

thick umbra
#

you are comparing colors in shader graph?

spiral drum
thick umbra
spiral drum
#

i mean

thick umbra
#

Yeah maybe provide more screenshots, context and code, instead of having me ask questions endlessly.