Get colour of a pixel on a texture?

Hi,

lets say I have a 10x10 pixel texture of different colour pixels. Is there a way to find the colour of the pixel at the position (1,5) on this texture? If so, how?

Any help is greatly appreciated, thanks.

Hey there

See: Unity - Scripting API: Texture2D.GetPixel

Once you have your texture object, you can simply say:

Color pixel_colour = my_texture.GetPixel(1,5);

And that’ll do it! :slight_smile:

-Chris

Documentation is your friend: Texture2D.GetPixel.