2006-08-13 21:38:49 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
e_color_update_rgb(E_Color *ec)
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
if (!ec) return;
|
|
|
|
evas_color_rgb_to_hsv(ec->r, ec->g, ec->b, &(ec->h), &(ec->s), &(ec->v));
|
2006-08-13 21:38:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_color_update_hsv(E_Color *ec)
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
if (!ec) return;
|
2017-01-06 09:56:22 -08:00
|
|
|
if (!EINA_FLT_NONZERO(ec->v))
|
2013-01-11 02:34:29 -08:00
|
|
|
ec->r = ec->g = ec->b = 0;
|
|
|
|
else
|
|
|
|
evas_color_hsv_to_rgb(ec->h, ec->s, ec->v, &(ec->r), &(ec->g), &(ec->b));
|
2006-08-13 21:38:49 -07:00
|
|
|
}
|
2006-08-15 21:43:20 -07:00
|
|
|
|
|
|
|
void
|
2006-08-20 15:15:27 -07:00
|
|
|
e_color_copy(const E_Color *from, E_Color *to)
|
2006-08-15 21:43:20 -07:00
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
if (!from || !to) return;
|
|
|
|
to->r = from->r;
|
|
|
|
to->g = from->g;
|
|
|
|
to->b = from->b;
|
|
|
|
to->h = from->h;
|
|
|
|
to->s = from->s;
|
|
|
|
to->v = from->v;
|
|
|
|
to->a = from->a;
|
2006-08-15 21:43:20 -07:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
|