Scroll to navigation

TICKIT_PEN_GET_COLOUR_ATTR(3) Library Functions Manual TICKIT_PEN_GET_COLOUR_ATTR(3)

NAME

tickit_pen_get_colour_attr, tickit_pen_set_colour_attr, tickit_pen_set_colour_attr_desc - manipulate a colour pen attribute

SYNOPSIS

#include <tickit.h>

int tickit_pen_get_colour_attr(TickitPen *pen, TickitPenAttr attr);
void tickit_pen_set_colour_attr(TickitPen *pen, TickitPenAttr attr, int val);
bool tickit_pen_set_colour_attr_desc(TickitPen *pen, TickitPenAttr attr,
    const char *desc);

Link with -ltickit.

DESCRIPTION

tickit_pen_get_colour_attr() returns the current value of the given colour attribute on the pen as a palette index, or -1 if that attribute is not defined.

tickit_pen_set_colour_attr() provides a new value for the given colour attribute on the pen as a palette index. If the pen previously stored a secondary RGB8 value for this attribute it will be cleared. It will invoke the TICKIT_EV_CHANGE event on the pen instance.

tickit_pen_set_colour_attr_desc() provides a new value for the given colour attribute on the pen as a textual description string, converting it into a colour index. It will invoke the TICKIT_EV_CHANGE event on the pen instance. It recognises decimal integers and the names of the first eight VGA colours (black, red, green, yellow, blue, magenta, cyan and white, respectively). It also recognises the prefix of "hi-" before one of the eight VGA colour names, to indicate the high-brightness versions at colour indexes 8 to 15. If it recognises the given string it returns a true value, or false if not.

RETURN VALUE

tickit_pen_get_colour_attr() returns an integer value. tickit_pen_set_colour_attr() returns no value. tickit_pen_set_colour_attr_desc() returns a boolean indicating success.

SEE ALSO

tickit_pen_new(3), tickit_pen_has_attr(3), tickit_pen_set_bool_attr(3), tickit_pen_set_int_attr(3), tickit_pen_clear_attr(3), tickit_pen(7), tickit(7)