color: formatting code using astyle

Origin commit data
------------------
Branch: ni/coolstream
Commit: 6eaac512fb
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-19 (Fri, 19 Nov 2021)

Origin message was:
------------------
- color: formatting code using astyle

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2021-11-19 21:51:01 +01:00
parent 61700d8d8c
commit 7e25b366e1
3 changed files with 114 additions and 90 deletions

View File

@@ -55,8 +55,10 @@ int convertSetupColor2RGB(const unsigned char r, const unsigned char g, const un
int convertSetupAlpha2Alpha(unsigned char alpha) int convertSetupAlpha2Alpha(unsigned char alpha)
{ {
if(alpha == 0) return 0xFF; if (alpha == 0)
else if(alpha >= 100) return 0; return 0xFF;
else if (alpha >= 100)
return 0;
int a = 100 - alpha; int a = 100 - alpha;
int ret = a * 0xFF / 100; int ret = a * 0xFF / 100;
return ret; return ret;
@@ -64,27 +66,27 @@ int convertSetupAlpha2Alpha(unsigned char alpha)
void recalcColor(unsigned char &orginal, int fade) void recalcColor(unsigned char &orginal, int fade)
{ {
if(fade==100) if (fade == 100)
{ {
return; return;
} }
int color = orginal * fade / 100; int color = orginal * fade / 100;
if(color>255) if (color > 255)
color=255; color = 255;
if(color<0) if (color < 0)
color=0; color = 0;
orginal = (unsigned char)color; orginal = (unsigned char)color;
} }
void protectColor( unsigned char &r, unsigned char &g, unsigned char &b, bool protect ) void protectColor(unsigned char &r, unsigned char &g, unsigned char &b, bool protect)
{ {
if (!protect) if (!protect)
return; return;
if ((r==0) && (g==0) && (b==0)) if ((r == 0) && (g == 0) && (b == 0))
{ {
r=1; r = 1;
g=1; g = 1;
b=1; b = 1;
} }
} }
@@ -93,7 +95,7 @@ void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, b
recalcColor(r, fade); recalcColor(r, fade);
recalcColor(g, fade); recalcColor(g, fade);
recalcColor(b, fade); recalcColor(b, fade);
protectColor(r,g,b, protect); protectColor(r, g, b, protect);
} }
uint8_t getBrightnessRGB(fb_pixel_t color) uint8_t getBrightnessRGB(fb_pixel_t color)
@@ -110,8 +112,10 @@ fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp)
{ {
int br_ = (int)getBrightnessRGB(color); int br_ = (int)getBrightnessRGB(color);
br_ += br; br_ += br;
if (br_ < 0) br_ = 0; if (br_ < 0)
if (br_ > 255) br_ = 255; br_ = 0;
if (br_ > 255)
br_ = 255;
return changeBrightnessRGB(color, (uint8_t)br_, transp); return changeBrightnessRGB(color, (uint8_t)br_, transp);
} }
@@ -152,17 +156,21 @@ void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb)
float f_H = hsv->h; float f_H = hsv->h;
float f_S = hsv->s; float f_S = hsv->s;
float f_V = hsv->v; float f_V = hsv->v;
if (fabsf(f_S) < FLT_EPSILON) { if (fabsf(f_S) < FLT_EPSILON)
{
rgb->r = (uint8_t)(f_V * 255); rgb->r = (uint8_t)(f_V * 255);
rgb->g = (uint8_t)(f_V * 255); rgb->g = (uint8_t)(f_V * 255);
rgb->b = (uint8_t)(f_V * 255); rgb->b = (uint8_t)(f_V * 255);
} else { }
else
{
float f_R; float f_R;
float f_G; float f_G;
float f_B; float f_B;
float hh = f_H; float hh = f_H;
if (hh >= 360) hh = 0; if (hh >= 360)
hh = 0;
hh /= 60; hh /= 60;
int i = (int)hh; int i = (int)hh;
float ff = hh - (float)i; float ff = hh - (float)i;
@@ -170,7 +178,8 @@ void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb)
float q = f_V * (1 - (f_S * ff)); float q = f_V * (1 - (f_S * ff));
float t = f_V * (1 - (f_S * (1 - ff))); float t = f_V * (1 - (f_S * (1 - ff)));
switch (i) { switch (i)
{
case 0: case 0:
f_R = f_V; f_G = t; f_B = p; f_R = f_V; f_G = t; f_B = p;
break; break;
@@ -211,10 +220,13 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv)
float f_H = 0; float f_H = 0;
float f_S = 0; float f_S = 0;
if (fabsf(delta) < FLT_EPSILON) { //gray if (fabsf(delta) < FLT_EPSILON) //gray
{
f_S = 0; f_S = 0;
f_H = 0; f_H = 0;
} else { }
else
{
f_S = (delta / max); f_S = (delta / max);
if (f_R >= max) if (f_R >= max)
f_H = (f_G - f_B) / delta; f_H = (f_G - f_B) / delta;
@@ -264,7 +276,7 @@ fb_pixel_t getRandomColor(col_range_t range_r, col_range_t range_g, col_range_t
{ {
if (!range_r.min || !range_g.min || !range_b.min) if (!range_r.min || !range_g.min || !range_b.min)
{ {
dprintf(DEBUG_NORMAL, "\033[31m[color.cpp] [Error:]\033[0m %s: color range min value < 1 in argument, allowed values are 1-255 [r: min%u/max%u] [g: min%u/max%u] [b: min%u/max%u]\n",__func__, range_r.min, range_r.max, range_g.min, range_g.max, range_b.min, range_b.max); dprintf(DEBUG_NORMAL, "\033[31m[color.cpp] [Error:]\033[0m %s: color range min value < 1 in argument, allowed values are 1-255 [r: min%u/max%u] [g: min%u/max%u] [b: min%u/max%u]\n", __func__, range_r.min, range_r.max, range_g.min, range_g.max, range_b.min, range_b.max);
return 0; return 0;
} }

View File

@@ -50,58 +50,61 @@
#define COL_MENUCONTENTSELECTED 254-8*2 #define COL_MENUCONTENTSELECTED 254-8*2
#define COL_MENUCONTENTINACTIVE 254-8*1 #define COL_MENUCONTENTINACTIVE 254-8*1
#define COL_BACKGROUND 255 #define COL_BACKGROUND 255
#ifdef FB_USE_PALETTE #ifdef FB_USE_PALETTE
#define COL_SHADOW_PLUS_0 (COL_SHADOW + 0)
#define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0) #define COL_SHADOW_PLUS_0 (COL_SHADOW + 0)
#define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1) #define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0)
#define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3) #define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1)
#define COL_INFOBAR_PLUS_7 (COL_INFOBAR + 7) #define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3)
#define COL_INFOBAR_CASYSTEM_PLUS_0 (COL_INFOBAR_CASYSTEM + 0) #define COL_INFOBAR_PLUS_7 (COL_INFOBAR + 7)
#define COL_INFOBAR_CASYSTEM_PLUS_2 (COL_INFOBAR_CASYSTEM + 2) #define COL_INFOBAR_CASYSTEM_PLUS_0 (COL_INFOBAR_CASYSTEM + 0)
#define COL_MENUHEAD_PLUS_0 (COL_MENUHEAD + 0) #define COL_INFOBAR_CASYSTEM_PLUS_2 (COL_INFOBAR_CASYSTEM + 2)
#define COL_MENUCONTENT_PLUS_0 (COL_MENUCONTENT + 0) #define COL_MENUHEAD_PLUS_0 (COL_MENUHEAD + 0)
#define COL_MENUCONTENT_PLUS_1 (COL_MENUCONTENT + 1) #define COL_MENUCONTENT_PLUS_0 (COL_MENUCONTENT + 0)
#define COL_MENUCONTENT_PLUS_2 (COL_MENUCONTENT + 2) #define COL_MENUCONTENT_PLUS_1 (COL_MENUCONTENT + 1)
#define COL_MENUCONTENT_PLUS_3 (COL_MENUCONTENT + 3) #define COL_MENUCONTENT_PLUS_2 (COL_MENUCONTENT + 2)
#define COL_MENUCONTENT_PLUS_4 (COL_MENUCONTENT + 4) #define COL_MENUCONTENT_PLUS_3 (COL_MENUCONTENT + 3)
#define COL_MENUCONTENT_PLUS_5 (COL_MENUCONTENT + 5) #define COL_MENUCONTENT_PLUS_4 (COL_MENUCONTENT + 4)
#define COL_MENUCONTENT_PLUS_6 (COL_MENUCONTENT + 6) #define COL_MENUCONTENT_PLUS_5 (COL_MENUCONTENT + 5)
#define COL_MENUCONTENT_PLUS_7 (COL_MENUCONTENT + 7) #define COL_MENUCONTENT_PLUS_6 (COL_MENUCONTENT + 6)
#define COL_MENUCONTENTDARK_PLUS_0 (COL_MENUCONTENTDARK + 0) #define COL_MENUCONTENT_PLUS_7 (COL_MENUCONTENT + 7)
#define COL_MENUCONTENTDARK_PLUS_2 (COL_MENUCONTENTDARK + 2) #define COL_MENUCONTENTDARK_PLUS_0 (COL_MENUCONTENTDARK + 0)
#define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0) #define COL_MENUCONTENTDARK_PLUS_2 (COL_MENUCONTENTDARK + 2)
#define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2) #define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0)
#define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) #define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2)
#define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0) #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0)
#define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) #define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0)
#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (COL_PROGRESSBAR + 0) #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0)
#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (COL_PROGRESSBAR + 0)
#else #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_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)])
#define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)]) #define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)])
#define COL_INFOBAR_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 3)]) #define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)])
#define COL_INFOBAR_PLUS_7 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 7)]) #define COL_INFOBAR_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 3)])
#define COL_INFOBAR_CASYSTEM_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_CASYSTEM + 0)]) #define COL_INFOBAR_PLUS_7 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 7)])
#define COL_INFOBAR_CASYSTEM_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_CASYSTEM + 2)]) #define COL_INFOBAR_CASYSTEM_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_CASYSTEM + 0)])
#define COL_MENUHEAD_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUHEAD + 0)]) #define COL_INFOBAR_CASYSTEM_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_CASYSTEM + 2)])
#define COL_MENUCONTENT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 0)]) #define COL_MENUHEAD_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUHEAD + 0)])
#define COL_MENUCONTENT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 1)]) #define COL_MENUCONTENT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 0)])
#define COL_MENUCONTENT_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 2)]) #define COL_MENUCONTENT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 1)])
#define COL_MENUCONTENT_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 3)]) #define COL_MENUCONTENT_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 2)])
#define COL_MENUCONTENT_PLUS_4 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 4)]) #define COL_MENUCONTENT_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 3)])
#define COL_MENUCONTENT_PLUS_5 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 5)]) #define COL_MENUCONTENT_PLUS_4 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 4)])
#define COL_MENUCONTENT_PLUS_6 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 6)]) #define COL_MENUCONTENT_PLUS_5 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 5)])
#define COL_MENUCONTENT_PLUS_7 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 7)]) #define COL_MENUCONTENT_PLUS_6 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 6)])
#define COL_MENUCONTENTDARK_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 0)]) #define COL_MENUCONTENT_PLUS_7 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENT + 7)])
#define COL_MENUCONTENTDARK_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 2)]) #define COL_MENUCONTENTDARK_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 0)])
#define COL_MENUCONTENTSELECTED_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 0)]) #define COL_MENUCONTENTDARK_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTDARK + 2)])
#define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)]) #define COL_MENUCONTENTSELECTED_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 0)])
#define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)]) #define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)])
#define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)]) #define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)])
#define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)]) #define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)])
#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_PROGRESSBAR + 0)]) #define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)])
#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_PROGRESSBAR + 0)])
// text colors // text colors
#define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)]) #define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)])
@@ -121,7 +124,8 @@
#define COL_MENUCONTENTINACTIVE_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 14)]) #define COL_MENUCONTENTINACTIVE_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 14)])
#define COL_INFOCLOCK_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 15)]) #define COL_INFOCLOCK_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 15)])
#define COL_PROGRESSBAR_ACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 16)]) #define COL_PROGRESSBAR_ACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 16)])
#endif
#endif // FB_USE_PALETTE
// some wrappers to get more readability // some wrappers to get more readability
#define COL_FRAME COL_MENUCONTENT_PLUS_1 //NI #define COL_FRAME COL_MENUCONTENT_PLUS_1 //NI
@@ -144,15 +148,17 @@
int convertSetupColor2RGB(unsigned char r, unsigned char g, unsigned char b); int convertSetupColor2RGB(unsigned char r, unsigned char g, unsigned char b);
int convertSetupAlpha2Alpha(unsigned char alpha); int convertSetupAlpha2Alpha(unsigned char alpha);
void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, bool protect=true); void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, bool protect = true);
typedef struct { typedef struct
{
uint8_t r; uint8_t r;
uint8_t g; uint8_t g;
uint8_t b; uint8_t b;
} RgbColor; } RgbColor;
typedef struct { typedef struct
{
float h; float h;
float s; float s;
float v; float v;
@@ -160,10 +166,10 @@ typedef struct {
uint8_t getBrightnessRGB(fb_pixel_t color); uint8_t getBrightnessRGB(fb_pixel_t color);
fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp=true); fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp = true);
fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp=true); fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp = true);
fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr=0xFF); fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr = 0xFF);
uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv);
void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb);
@@ -172,12 +178,13 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv);
void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool toggle_background = false, bool toggle_enlighten = false); void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool toggle_background = false, bool toggle_enlighten = false);
typedef struct { typedef struct
{
uint8_t min; uint8_t min;
uint8_t max; uint8_t max;
} col_range_t; } col_range_t;
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); 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);
#endif #endif

View File

@@ -2,7 +2,9 @@
#define __color_custom__ #define __color_custom__
#define COLOR_CUSTOM 0x0 #define COLOR_CUSTOM 0x0
#ifdef FB_USE_PALETTE #ifdef FB_USE_PALETTE
/* /*
#define COL_WHITE (COLOR_CUSTOM + 0) #define COL_WHITE (COLOR_CUSTOM + 0)
#define COL_RED (COLOR_CUSTOM + 1) #define COL_RED (COLOR_CUSTOM + 1)
@@ -25,7 +27,9 @@
#define COL_LIGHT_BLUE 0x0F #define COL_LIGHT_BLUE 0x0F
#define COL_WHITE 0x10 #define COL_WHITE 0x10
#define COL_BLACK 0x11 #define COL_BLACK 0x11
#else #else
#define COL_DARK_RED0 0x02 #define COL_DARK_RED0 0x02
#define COL_DARK_GREEN0 0x03 #define COL_DARK_GREEN0 0x03
#define COL_OLIVE0 0x04 #define COL_OLIVE0 0x04
@@ -55,7 +59,8 @@
#define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[0x0F]) #define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[0x0F])
#define COL_WHITE (CFrameBuffer::getInstance()->realcolor[0x10]) #define COL_WHITE (CFrameBuffer::getInstance()->realcolor[0x10])
#define COL_BLACK (CFrameBuffer::getInstance()->realcolor[0x11]) #define COL_BLACK (CFrameBuffer::getInstance()->realcolor[0x11])
#endif
#endif // FB_USE_PALETTE
#define COL_RANDOM (getRandomColor()) #define COL_RANDOM (getRandomColor())