Support and General Use > Theming and Appearance Customization

Colour selector and anti aliased fonts

(1/1)

cereal_killer:
What color code does the Rockbox colour selector use? You can set Red and Blue from 0 to 31 and Green from 0 to 63 and not from 0 to 255. The HEX Code is shown in the coloured box. If I know the RGB or the HEX code, how would I achieve the desired colour using the colour selector?

I gathered a lot of anti aliased fonts like Ubuntu, Roboto, DejaVuSans or DroidSans in various sizes and in .fnt format. Some of them were floating around in the forums or on the IRC. [Saint] once created the Roboto ones including a licence, so I think I could share the without a problem. The git repository is empty now though. I could provide these fonts, if theme creators are interested, but I would like to be sure, that I don't violate any rights. Please let me know if there is interest, or even the chance to include them into the Rockox font pack.

Bilgus:
RGB
00000000 11111111 00000000
FF       FF       FF

RGB 565
00000 111111 00000
F8    7E     1F
0xF8 = 248
0x7E = 126
0x1F = 31

R 48
G 79
B 254
0x304FFE

R -> convert 0-255 to 0-31
(48 >> 3) & 31 = 6
0000 0000 0000 0110
<< 11 bits = decimal 12288
0011 0000 0000 0000

G -> convert 0-255 to 0- 63
(79 >> 2) & 63 = 19
0000 0000 0001 0011
<< 5 bits = decimal 608
0000 0010 0110 0000

B -> convert 0-255 to 0-31
(254 >> 3) & 31 = 31
0000 0000 0001 1111
12288 + 608 + 31 = 12927
hex = 0x327F

in the color selector you would choose 06 19 31

cereal_killer:
Thank you for your help and explanation Bilgus. This helps a lot. Do all supported players have screens with 16 bit colour-depth or are there any with 24 bit that use RGB888?

I uploaded the above mentioned anti-aliased font packs on the extras site: https://www.rockbox.org/wiki/RockboxExtras

I hope they are useful for theme makers.

Navigation

[0] Message Index

Go to full version