diff options
Diffstat (limited to 'src/color.c')
-rw-r--r-- | src/color.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/color.c b/src/color.c index a7573fe..8f5b71b 100644 --- a/src/color.c +++ b/src/color.c @@ -1,22 +1,11 @@ -static float _fr, _fg, _fb; -static float _br, _bg, _bb; - -void setfgcolor(float r, float g, float b) { - _fr = r; - _fg = g; - _fb = b; -} - -void setbgcolor(float r, float g, float b) { - _br = r; - _bg = g; - _bb = b; -} - -void fgcolor() { - TZR_DrawSetColor(_fr, _fg, _fb); -} - -void bgcolor() { - TZR_DrawSetColor(_br, _bg, _bb); +NAME(color); +PARENT(trigger); + +IMPL(enter) { + if (this->color_group) + setfgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g, + 1. / 255. * this->color.b); + else + setbgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g, + 1. / 255. * this->color.b); } |