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.
Comment
Answer by wibble82 · Dec 21, 2015 at 04:14 PM
Hey there
See: http://docs.unity3d.com/ScriptReference/Texture2D.GetPixel.html
Once you have your texture object, you can simply say:
Color pixel_colour = my_texture.GetPixel(1,5);
And that'll do it! :)
-Chris
Your answer
Follow this Question
Related Questions
Unable to create a coloured mesh on a canvas. 1 Answer
Are there no other way to paint Unity terrain than with textures? 1 Answer
Unity2D: Remove Shader Colour 0 Answers
Help with SetPixels32 0 Answers
TextureType grayscale 0 Answers