Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Colour selector and anti aliased fonts
« previous next »
  • Print
Pages: [1]

Author Topic: Colour selector and anti aliased fonts  (Read 487 times)

Offline cereal_killer

  • Member
  • *
  • Posts: 425
Colour selector and anti aliased fonts
« on: August 03, 2021, 04:10:49 PM »
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.
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 819
Re: Colour selector and anti aliased fonts
« Reply #1 on: August 05, 2021, 09:45:41 AM »
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
Logged

Offline cereal_killer

  • Member
  • *
  • Posts: 425
Re: Colour selector and anti aliased fonts
« Reply #2 on: August 18, 2021, 04:19:07 PM »
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.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Colour selector and anti aliased fonts
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.024 seconds with 16 queries.