- color_custom: cleanup; remove FB_USE_PALETTE

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-11-25 21:47:09 +01:00
committed by Thilo Graf
parent fccf8ab8d6
commit 46d7921d2c
3 changed files with 38 additions and 95 deletions

View File

@@ -47,6 +47,7 @@
#include <gui/audiomute.h>
#include <gui/color.h>
#include <gui/color_custom.h>
#include <gui/osd_helpers.h>
#include <gui/pictureviewer.h>
#include <system/debug.h>
@@ -181,26 +182,26 @@ void CFrameBuffer::init(const char * const fbDevice)
}
/* Google Material Colors */
paletteSetColor(0x01, 0x010101, tr); // what's this?
paletteSetColor(0x02, 0xFFFFFF, tr); // COL_WHITE
paletteSetColor(0x03, 0x000000, tr); // COL_BLACK
paletteSetColor(0x04, 0xb71c1c, tr); // COL_DARK_RED red 900
paletteSetColor(0x05, 0xf44336, tr); // COL_RED red 500
paletteSetColor(0x06, 0xe57373, tr); // COL_LIGHT_RED red 300
paletteSetColor(0x07, 0x1b5e20, tr); // COL_DARK_GREEN green 900
paletteSetColor(0x08, 0x4caf50, tr); // COL_GREEN green 500
paletteSetColor(0x09, 0x81c784, tr); // COL_LIGHT_GREEN green 300
paletteSetColor(0x0A, 0xf9a825, tr); // COL_DARK_YELLOW yellow 800
paletteSetColor(0x0B, 0xffeb3b, tr); // COL_YELLOW yellow 500
paletteSetColor(0x0C, 0xfff176, tr); // COL_LIGHT_YELLOW yellow 300
paletteSetColor(0x0D, 0x1a237e, tr); // COL_DARK_BLUE indigo 900
paletteSetColor(0x0E, 0x3f51b5, tr); // COL_BLUE indigo 500
paletteSetColor(0x0F, 0x7986cb, tr); // COL_LIGHT_BLUE indigo 300
paletteSetColor(0x10, 0x424242, tr); // COL_DARK_GRAY grey 800
paletteSetColor(0x11, 0x9e9e9e, tr); // COL_GRAY grey 500
paletteSetColor(0x12, 0xe0e0e0, tr); // COL_LIGHT_GRAY grey 300
paletteSetColor(0x01, 0x010101, tr); // what's this?
paletteSetColor(COL_WHITE0, 0xFFFFFF, tr);
paletteSetColor(COL_BLACK0, 0x000000, tr);
paletteSetColor(COL_DARK_RED0, 0xb71c1c, tr); // red 900
paletteSetColor(COL_RED0, 0xf44336, tr); // red 500
paletteSetColor(COL_LIGHT_RED0, 0xe57373, tr); // red 300
paletteSetColor(COL_DARK_GREEN0, 0x1b5e20, tr); // green 900
paletteSetColor(COL_GREEN0, 0x4caf50, tr); // green 500
paletteSetColor(COL_LIGHT_GREEN0, 0x81c784, tr); // green 300
paletteSetColor(COL_DARK_YELLOW0, 0xf9a825, tr); // yellow 800
paletteSetColor(COL_YELLOW0, 0xffeb3b, tr); // yellow 500
paletteSetColor(COL_LIGHT_YELLOW0, 0xfff176, tr); // yellow 300
paletteSetColor(COL_DARK_BLUE0, 0x1a237e, tr); // indigo 900
paletteSetColor(COL_BLUE0, 0x3f51b5, tr); // indigo 500
paletteSetColor(COL_LIGHT_BLUE0, 0x7986cb, tr); // indigo 300
paletteSetColor(COL_DARK_GRAY0, 0x424242, tr); // grey 800
paletteSetColor(COL_GRAY0, 0x9e9e9e, tr); // grey 500
paletteSetColor(COL_LIGHT_GRAY0, 0xe0e0e0, tr); // grey 300
paletteSetColor(COL_BACKGROUND, 0x000000, 0x0);
paletteSetColor(COL_BACKGROUND, 0x000000, 0x0);
paletteSet();

View File

@@ -52,35 +52,6 @@
#define COL_BACKGROUND 255
#ifdef FB_USE_PALETTE
#define COL_SHADOW_PLUS_0 (COL_SHADOW + 0)
#define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0)
#define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1)
#define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3)
#define COL_INFOBAR_PLUS_7 (COL_INFOBAR + 7)
#define COL_INFOBAR_CASYSTEM_PLUS_0 (COL_INFOBAR_CASYSTEM + 0)
#define COL_INFOBAR_CASYSTEM_PLUS_2 (COL_INFOBAR_CASYSTEM + 2)
#define COL_MENUHEAD_PLUS_0 (COL_MENUHEAD + 0)
#define COL_MENUCONTENT_PLUS_0 (COL_MENUCONTENT + 0)
#define COL_MENUCONTENT_PLUS_1 (COL_MENUCONTENT + 1)
#define COL_MENUCONTENT_PLUS_2 (COL_MENUCONTENT + 2)
#define COL_MENUCONTENT_PLUS_3 (COL_MENUCONTENT + 3)
#define COL_MENUCONTENT_PLUS_4 (COL_MENUCONTENT + 4)
#define COL_MENUCONTENT_PLUS_5 (COL_MENUCONTENT + 5)
#define COL_MENUCONTENT_PLUS_6 (COL_MENUCONTENT + 6)
#define COL_MENUCONTENT_PLUS_7 (COL_MENUCONTENT + 7)
#define COL_MENUCONTENTDARK_PLUS_0 (COL_MENUCONTENTDARK + 0)
#define COL_MENUCONTENTDARK_PLUS_2 (COL_MENUCONTENTDARK + 2)
#define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0)
#define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2)
#define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0)
#define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0)
#define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0)
#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (COL_PROGRESSBAR + 0)
#else
#define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)])
#define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)])
#define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)])
@@ -125,8 +96,6 @@
#define COL_INFOCLOCK_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 15)])
#define COL_PROGRESSBAR_ACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 16)])
#endif // FB_USE_PALETTE
// some wrappers to get more readability
#define COL_FRAME COL_MENUCONTENT_PLUS_6
#define COL_FRAME_PLUS_0 COL_FRAME
@@ -186,5 +155,6 @@ typedef struct
fb_pixel_t getRandomColor(col_range_t range_r = {1, 255}, col_range_t range_g = {1, 255}, col_range_t range_b = {1, 255}, uint8_t Alpha = 0);
#define COL_RANDOM (getRandomColor())
#endif

View File

@@ -1,30 +1,6 @@
#ifndef __color_custom__
#define __color_custom__
#define COLOR_CUSTOM 0x0
#ifdef FB_USE_PALETTE
#define COL_WHITE 0x02
#define COL_BLACK 0x03
#define COL_DARK_RED 0x04
#define COL_RED 0x05
#define COL_LIGHT_RED 0x06
#define COL_DARK_GREEN 0x07
#define COL_GREEN 0x08
#define COL_LIGHT_GREEN 0x09
#define COL_DARK_YELLOW 0x0A
#define COL_YELLOW 0x0B
#define COL_LIGHT_YELLOW 0x0C
#define COL_DARK_BLUE 0x0D
#define COL_BLUE 0x0E
#define COL_LIGHT_BLUE 0x0F
#define COL_DARK_GRAY 0x10
#define COL_GRAY 0x11
#define COL_LIGHT_GRAY 0x12
#else
#define COL_WHITE0 0x02
#define COL_BLACK0 0x03
#define COL_DARK_RED0 0x04
@@ -43,26 +19,22 @@
#define COL_GRAY0 0x11
#define COL_LIGHT_GRAY0 0x12
#define COL_WHITE (CFrameBuffer::getInstance()->realcolor[0x02])
#define COL_BLACK (CFrameBuffer::getInstance()->realcolor[0x03])
#define COL_DARK_RED (CFrameBuffer::getInstance()->realcolor[0x04])
#define COL_RED (CFrameBuffer::getInstance()->realcolor[0x05])
#define COL_LIGHT_RED (CFrameBuffer::getInstance()->realcolor[0x06])
#define COL_DARK_GREEN (CFrameBuffer::getInstance()->realcolor[0x07])
#define COL_GREEN (CFrameBuffer::getInstance()->realcolor[0x08])
#define COL_LIGHT_GREEN (CFrameBuffer::getInstance()->realcolor[0x09])
#define COL_DARK_YELLOW (CFrameBuffer::getInstance()->realcolor[0x0A])
#define COL_YELLOW (CFrameBuffer::getInstance()->realcolor[0x0B])
#define COL_LIGHT_YELLOW (CFrameBuffer::getInstance()->realcolor[0x0C])
#define COL_DARK_BLUE (CFrameBuffer::getInstance()->realcolor[0x0D])
#define COL_BLUE (CFrameBuffer::getInstance()->realcolor[0x0E])
#define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[0x0F])
#define COL_DARK_GRAY (CFrameBuffer::getInstance()->realcolor[0x10])
#define COL_GRAY (CFrameBuffer::getInstance()->realcolor[0x11])
#define COL_LIGHT_GRAY (CFrameBuffer::getInstance()->realcolor[0x12])
#endif // FB_USE_PALETTE
#define COL_RANDOM (getRandomColor())
#define COL_WHITE (CFrameBuffer::getInstance()->realcolor[COL_WHITE0])
#define COL_BLACK (CFrameBuffer::getInstance()->realcolor[COL_BLACK0])
#define COL_DARK_RED (CFrameBuffer::getInstance()->realcolor[COL_DARK_RED0])
#define COL_RED (CFrameBuffer::getInstance()->realcolor[COL_RED0])
#define COL_LIGHT_RED (CFrameBuffer::getInstance()->realcolor[COL_LIGHT_RED0])
#define COL_DARK_GREEN (CFrameBuffer::getInstance()->realcolor[COL_DARK_GREEN0])
#define COL_GREEN (CFrameBuffer::getInstance()->realcolor[COL_GREEN0])
#define COL_LIGHT_GREEN (CFrameBuffer::getInstance()->realcolor[COL_LIGHT_GREEN0])
#define COL_DARK_YELLOW (CFrameBuffer::getInstance()->realcolor[COL_DARK_YELLOW0])
#define COL_YELLOW (CFrameBuffer::getInstance()->realcolor[COL_YELLOW0])
#define COL_LIGHT_YELLOW (CFrameBuffer::getInstance()->realcolor[COL_LIGHT_YELLOW0])
#define COL_DARK_BLUE (CFrameBuffer::getInstance()->realcolor[COL_DARK_BLUE0])
#define COL_BLUE (CFrameBuffer::getInstance()->realcolor[COL_BLUE0])
#define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[COL_LIGHT_BLUE0])
#define COL_DARK_GRAY (CFrameBuffer::getInstance()->realcolor[COL_DARK_GRAY0])
#define COL_GRAY (CFrameBuffer::getInstance()->realcolor[COL_GRAY0])
#define COL_LIGHT_GRAY (CFrameBuffer::getInstance()->realcolor[COL_LIGHT_GRAY0])
#endif