Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

char const* caca_get_color_name ( enum caca_color  color  ) 

Translate a colour index into the colour's name.

This function translates a caca_color enum into a human-readable description string of the associated colour.

Parameters:
color The colour value.
Returns:
A static string containing the colour's name.

Definition at line 241 of file caca.c.

{
    static char const *color_names[] =
    {
        "black",
        "blue",
        "green",
        "cyan",
        "red",
        "magenta",
        "brown",
        "light gray",
        "dark gray",
        "light blue",
        "light green",
        "light cyan",
        "light red",
        "light magenta",
        "yellow",
        "white",
    };

    if(color < 0 || color > 15)
        return "unknown";

    return color_names[color];
}


Generated by  Doxygen 1.6.0   Back to index