Tuesday, December 16, 2014

Unity3D manually code the color

So you can set the Color as below

newanimal.renderer.material.color = Color.white;

but if you want more accurate color you can go to below website to get the red, green, blue 

http://www.rapidtables.com/web/color/RGB_Color.htm

let say you want the chocolate, you get (184,134,11)
but in unity the color is between 0 and 1, so you need to divide the color you found by 256.0, as below


newanimal.renderer.material.color = Color(184/256.0134/256.011/256.0);

No comments:

Post a Comment