Memo for myself: how to convert from/to RGB and HSV. It is explained on this Wikipedia page, and can be implemented in C as follow (given equalf, modulof are respectively the equality and modulo operators for floating point values):
and:
If you want to know more about other color spaces, read this article.