1TICKIT_PEN_GET_COLOUR_ATTR(3L)ibrary Functions ManuaTlICKIT_PEN_GET_COLOUR_ATTR(3)
2
3
4

NAME

6       tickit_pen_get_colour_attr,                 tickit_pen_set_colour_attr,
7       tickit_pen_set_colour_attr_desc - manipulate a colour pen attribute
8

SYNOPSIS

10       #include <tickit.h>
11
12       int tickit_pen_get_colour_attr(TickitPen *pen, TickitPenAttr attr);
13       void tickit_pen_set_colour_attr(TickitPen *pen, TickitPenAttr attr, int val);
14       bool tickit_pen_set_colour_attr_desc(TickitPen *pen, TickitPenAttr attr,
15           const char *desc);
16
17       Link with -ltickit.
18

DESCRIPTION

20       tickit_pen_get_colour_attr() returns the current  value  of  the  given
21       colour attribute on the pen as a palette index, or -1 if that attribute
22       is not defined.
23
24       tickit_pen_set_colour_attr() provides a new value for the given  colour
25       attribute on the pen as a palette index. If the pen previously stored a
26       secondary RGB8 value for this attribute it will be cleared. It will in‐
27       voke the TICKIT_EV_CHANGE event on the pen instance.
28
29       tickit_pen_set_colour_attr_desc()  provides  a  new value for the given
30       colour attribute on the pen as a textual description string, converting
31       it  into  a  colour index. It will invoke the TICKIT_EV_CHANGE event on
32       the pen instance. It recognises decimal integers and the names  of  the
33       first eight VGA colours (black, red, green, yellow, blue, magenta, cyan
34       and white, respectively). It also recognises the prefix of "hi-" before
35       one of the eight VGA colour names, to indicate the high-brightness ver‐
36       sions at colour indexes 8 to 15. If it recognises the given  string  it
37       returns a true value, or false if not.
38
39       Additionally,  the  string  may  be  followed  by an RGB8 specification
40       formed from a hash symbol and 6 hexadecimal characters. If present, the
41       secondary  RGB8  value  will also be set. Optional space characters be‐
42       tween the base colour name and the hash symbol will be ignored.
43
44       For example,
45
46         tickit_pen_set_colour_attr_desc(pen, TICKIT_PEN_FG, "red #FF1515");
47
48       is eqiuvalent to setting the basic red colour along with the  secondary
49       RGB8 value of { .r = 0xFF, .g = 0x15, .b = 0x15}.
50

RETURN VALUE

52       tickit_pen_get_colour_attr()      returns     an     integer     value.
53       tickit_pen_set_colour_attr()         returns         no          value.
54       tickit_pen_set_colour_attr_desc() returns a boolean indicating success.
55

SEE ALSO

57       tickit_pen_new(3), tickit_pen_has_attr(3), tickit_pen_set_bool_attr(3),
58       tickit_pen_set_int_attr(3),  tickit_pen_clear_attr(3),   tickit_pen(7),
59       tickit(7)
60
61
62
63                                                 TICKIT_PEN_GET_COLOUR_ATTR(3)
Impressum