diff options
| author | Brandon Low <lostlogic@rockbox.org> | 2007-06-17 21:16:34 +0000 |
|---|---|---|
| committer | Brandon Low <lostlogic@rockbox.org> | 2007-06-17 21:16:34 +0000 |
| commit | 74cbb0a1b24a5d2e32d2667b236483b5e7253e98 (patch) | |
| tree | 4a9bd83a01bbb822305e3a567362fb3b36dfc28b /apps/settings.c | |
| parent | b57806237d275b54380be5b73e3d783bd6972bf8 (diff) | |
| download | rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.zip rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.gz rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.bz2 rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.xz | |
Give color targets the ability to display each LCD line a different color and use this newfangled ability to provide themable colored file types. See the comments on read_color_theme_file and the sample.colors file provided for how to use this. .colors files go in themes directory for now. This separate line color function should be trivial to add to menus and wpss.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13656 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
| -rw-r--r-- | apps/settings.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/apps/settings.c b/apps/settings.c index 09c90af..11d719f 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -227,38 +227,6 @@ void settings_load(int which) settings_load_config(FIXEDSETTINGSFILE,false); } } -#ifdef HAVE_LCD_COLOR -/* - * Helper function to convert a string of 6 hex digits to a native colour - */ - -#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \ - (toupper(c)) - 'A' + 10) - -static int hex_to_rgb(const char* hex) -{ int ok = 1; - int i; - int red, green, blue; - - if (strlen(hex) == 6) { - for (i=0; i < 6; i++ ) { - if (!isxdigit(hex[i])) { - ok=0; - break; - } - } - - if (ok) { - red = (hex2dec(hex[0]) << 4) | hex2dec(hex[1]); - green = (hex2dec(hex[2]) << 4) | hex2dec(hex[3]); - blue = (hex2dec(hex[4]) << 4) | hex2dec(hex[5]); - return LCD_RGBPACK(red,green,blue); - } - } - - return 0; -} -#endif /* HAVE_LCD_COLOR */ static bool cfg_string_to_int(int setting_id, int* out, char* str) { @@ -891,6 +859,11 @@ void settings_apply(void) #endif /* load the icon set */ icons_init(); + +#ifdef HAVE_LCD_COLOR + if (global_settings.colors_file) + read_color_theme_file(); +#endif } |