summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/text_editor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index 6b6e449ae9..780516e896 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -273,7 +273,7 @@ int do_item_menu(int cur_sel, char* copy_buffer)
273 || (c>='0' && c<= '9')) 273 || (c>='0' && c<= '9'))
274#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \ 274#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \
275 (toupper(c)) - 'A' + 10) 275 (toupper(c)) - 'A' + 10)
276int hex_to_rgb(const char* hex) 276int hex_to_rgb(const char* hex, int* color)
277{ int ok = 1; 277{ int ok = 1;
278 int i; 278 int i;
279 int red, green, blue; 279 int red, green, blue;
@@ -290,11 +290,12 @@ int hex_to_rgb(const char* hex)
290 red = (hex2dec(hex[0]) << 4) | hex2dec(hex[1]); 290 red = (hex2dec(hex[0]) << 4) | hex2dec(hex[1]);
291 green = (hex2dec(hex[2]) << 4) | hex2dec(hex[3]); 291 green = (hex2dec(hex[2]) << 4) | hex2dec(hex[3]);
292 blue = (hex2dec(hex[4]) << 4) | hex2dec(hex[5]); 292 blue = (hex2dec(hex[4]) << 4) | hex2dec(hex[5]);
293 return LCD_RGBPACK(red,green,blue); 293 *color = LCD_RGBPACK(red,green,blue);
294 return 0;
294 } 295 }
295 } 296 }
296 297
297 return 0; 298 return -1;
298} 299}
299#endif /* HAVE_LCD_COLOR */ 300#endif /* HAVE_LCD_COLOR */
300 301
@@ -407,7 +408,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
407 case 1: 408 case 1:
408 edit_text = false; 409 edit_text = false;
409 if (value) 410 if (value)
410 color = hex_to_rgb(value); 411 hex_to_rgb(value, &color);
411 else color = 0; 412 else color = 0;
412 rb->strcpy(extension, name); 413 rb->strcpy(extension, name);
413 rb->set_color(rb->screens[SCREEN_MAIN], name, &color, -1); 414 rb->set_color(rb->screens[SCREEN_MAIN], name, &color, -1);