From 95292027625e905080f37f585402f49ec49bc97f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 22 Jul 2017 09:14:51 +0200 Subject: moved color handling to video driver from generic VGA driver --- src/drivers/video/video.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/drivers/video/video.c') diff --git a/src/drivers/video/video.c b/src/drivers/video/video.c index bdadf53..ca57269 100644 --- a/src/drivers/video/video.c +++ b/src/drivers/video/video.c @@ -119,3 +119,33 @@ bool video_switch_mode( void *obj, const video_mode_t *mode ) return false; } +video_rgb_color_t video_make_rgb_color( const int R, const int G, const int B ) +{ + video_rgb_color_t c; + + c.R = R; + c.G = G; + c.B = B; + + return c; +} + +const video_rgb_color_t VIDEO_RGB_COLOR_BLACK = { 0x00, 0x00, 0x00 }; +const video_rgb_color_t VIDEO_RGB_COLOR_BLUE = { 0x00, 0x00, 0xAA }; +const video_rgb_color_t VIDEO_RGB_COLOR_GREEN = { 0x00, 0xAA, 0x00 }; +const video_rgb_color_t VIDEO_RGB_COLOR_CYAN = { 0x00, 0xAA, 0xAA }; +const video_rgb_color_t VIDEO_RGB_COLOR_RED = { 0xAA, 0x00, 0x00 }; +const video_rgb_color_t VIDEO_RGB_COLOR_MAGENTA = { 0xAA, 0x00, 0xAA }; +const video_rgb_color_t VIDEO_RGB_COLOR_BROWN = { 0xAA, 0x55, 0x00 }; +const video_rgb_color_t VIDEO_RGB_COLOR_GRAY = { 0xAA, 0xAA, 0xAA }; +const video_rgb_color_t VIDEO_RGB_COLOR_WHITE = { 0xFF, 0xFF, 0xFF }; + +/* +0x8 0x38 21,21,21 85,85,85 #555555 dark gray +0x9 0x39 21,21,63 85,85,255 #5555ff bright blue +0xA 0x3A 21,63,21 85,255,85 #55ff55 bright green +0xB 0x3B 21,63,63 85,255,255 #55ffff bright cyan +0xC 0x3C 63,21,21 255,85,85 #ff5555 bright red +0xD 0X3D 63,21,63 255,85,255 #ff55ff bright magenta +0xE 0x3E 63,63,21 255,255,85 #ffff55 yellow +*/ -- cgit v1.2.3-54-g00ecf