I could not find this on the web so i figured it out myself.

Here is how you can convert the numbers used in data structures to represent colors to RGB values and vice versa:

The numbers 0 - 888 represent RGB values where every digit stands for one color. So 870 would be 8 for red, 7 for green and 0 for blue. This is equivalent to RGB (255, 223, 0). A digit 9 is the same as digit 8, so 858 = 959. The exact calculation is in the patch: