Converting between color decimal and hexadecimal representation