Color Value Isn't Right That Way Should Be

Color value changes for no reason im trying to get color from image for each pixel.
When i get color its returns different every single time thats why i cant get it

My color is on inspector is 0,0,0 alpha 1
When i get pixel its has to be return 0,0,0 but it return this
8143004--1057268--upload_2022-5-20_15-31-25.png
and 0.004 breaks my code.

this is the image that im getting pixel colors;


and the picture;

I heard from somebody before “float equals isn’t right way to do” i tested with mathf.

var theVal = Mathf.Approximately(color1.r, color2.r);

returns False even they are so close.
8143004--1057298--upload_2022-5-20_16-13-10.png

Make sure compression is off in your texture settings (not the sprite settings)
Make sure non-power-of-two is set to none in the texture settings.
Double-check your image by drawing the black pixels again in your art package.

1 Like

I solved with

Mathf.Abs(a-b) < 0.02;