GRASS Programmer's Manual  6.4.2(2012)
driver/Color.c
Go to the documentation of this file.
00001 #include <grass/colors.h>
00002 #include "driver.h"
00003 #include "driverlib.h"
00004 
00005 int DRV_lookup_color(int r, int g, int b)
00006 {
00007     if (driver->lookup_color)
00008         return (*driver->lookup_color) (r, g, b);
00009     return 0;
00010 }
00011 
00012 void DRV_color(int number)
00013 {
00014     if (driver->color)
00015         (*driver->color) (number);
00016 }
00017 
00018 
00019 void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
00020 {
00021     DRV_color(DRV_lookup_color(r, g, b));
00022 }
00023 
00024 void COM_Standard_color(int number)
00025 {
00026     struct color_rgb rgb;
00027 
00028     if (number < 0 || number >= G_num_standard_colors())
00029         return;
00030 
00031     rgb = G_standard_color_rgb(number);
00032     COM_Color_RGB(rgb.r, rgb.g, rgb.b);
00033 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines