TICKIT_PEN_HAS_COLOUR_ATTR_RGB8(3)
π tickit_pen_get_colour_attr_rgb8 β Library Functions Manual β¨
okay bestie, gather round, because we're about to talk about secondary RGB8 colour attributes on a pen and honestly? it's giving niche-but-important π
πΈ NAME πΈ
tickit_pen_get_colour_attr_rgb8, tickit_pen_set_colour_attr_rgb8, tickit_pen_has_attr_rgb8 β the trio that lets you manipulate a secondary RGB8 colour pen colour attribute π
π¦ SYNOPSIS π¦
#include <tickit.h>
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
} TickitPenRGB8;
TickitPenRGB8 tickit_pen_get_colour_attr_rgb8(const TickitPen *pen,
TickitPenAttr attr);
void tickit_pen_set_colour_attr_rgb8(TickitPen *pen,
TickitPenAttr attr, TickitPenRGB8 value);
bool tickit_pen_has_attr_rgb8(const TickitPen *pen,
TickitPenAttr attr);
and don't forget, when you link:
Link with -ltickit.
π DESCRIPTION π
tickit_pen_get_colour_attr_rgb8() hands you back the current secondary RGB8 value of whatever colour attribute you asked for. but listen β if the attribute isn't defined, or it doesn't have a secondary RGB8 value? the return value is not specified. so like, don't be surprised, it's undefined bestie π
tickit_pen_set_colour_attr_rgb8() gives the given colour attribute on the pen a brand new secondary RGB8 value. huge. BUT π it will only be stored if the pen already has a (primary) index value set for the corresponding attribute. that's the rule, no exceptions. and if it does successfully store the value, it invokes the TICKIT_EV_CHANGE event on the pen instance. slay π₯
tickit_pen_has_colour_attr_rgb8() returns true if the pen instance currently stores a secondary RGB8 value for the given colour attribute. simple as that π«Ά
π NOTES π
real talk: a pen instance will only store a secondary RGB8 value if a primary index value is already set. and on top of that? calling tickit_pen_set_colour_attr(3) will clear an associated secondary RGB8 value. poof, gone π
the whole design here is intentional β it aims to encourage that any use of an RGB8 colour also has an index as well, so that it supports the majority of terminals which do not in fact understand RGB8 values. iconic, honestly.
so if your application wants to make use of these values, the recommendation is: set both at the same time, in sequence. like this:
tickit_pen_set_colour_attr(pen, index);
tickit_pen_set_colour_attr_rgb8(pen,
(TickitPenRGB8){.r = red, .g = green, .b = blue});
β RETURN VALUE β
tickit_pen_get_colour_attr_rgb8()β returns a three-field colour value structure πtickit_pen_set_colour_attr_rgb8()β returns no value (it's a void girlie, she just does the thing)tickit_pen_has_colour_attr_rgb8()β returns a boolean
π SEE ALSO π
and that's the whole page, bestie π this was TICKIT_PEN...R_ATTR_RGB8(3) from the Library Functions Manual β go forth and set your primary index and your RGB8 together, in sequence, like the responsible main character you are πβ¨
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms