python - How to generate random 'greenish' colors -


Anyone have any suggestions for making random colors that are all green? Right now I am creating color by:

  color = (RANDIN (100, 200), RANDIN (120, 255), RANDIN (100, 200))   

It mostly works, but I get lots of brown color.

Simple solution: Use color space instead of RGB RGB later If you need it). Inter Tupal means: Where values ​​in HSL for RGB red, green and blue, H color (for example, green 120 degrees or 0.33) and S. is for V for saturation and brightness. Then put H at a fixed price (or you can add it to a random random number by adding / randomizing it for more random colors) and make S and V random. See the article.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -