forked from enlightenment/enlightenment
parent
822776146a
commit
1ee20d2068
|
@ -67,26 +67,31 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
|
|||
if (wd->cv->r > 255) wd->cv->r = 255;
|
||||
if (wd->cv->r < 0) wd->cv->r = 0;
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_G:
|
||||
wd->cv->g = atoi(wd->values[i]);
|
||||
if (wd->cv->g > 255) wd->cv->g = 255;
|
||||
if (wd->cv->g < 0) wd->cv->g = 0;
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_B:
|
||||
wd->cv->b = atoi(wd->values[i]);
|
||||
if (wd->cv->b > 255) wd->cv->b = 255;
|
||||
if (wd->cv->b < 0) wd->cv->b = 0;
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_H:
|
||||
wd->cv->h = atof(wd->values[i]);
|
||||
if (wd->cv->h > 360) wd->cv->h = 360;
|
||||
if (wd->cv->h < 0) wd->cv->h = 0;
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_S:
|
||||
wd->cv->s = atof(wd->values[i]);
|
||||
if (wd->cv->s > 1) wd->cv->s = 1;
|
||||
if (wd->cv->s < 0) wd->cv->s = 0;
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_V:
|
||||
wd->cv->v = atof(wd->values[i]);
|
||||
if (wd->cv->v > 1) wd->cv->v = 1;
|
||||
|
@ -100,7 +105,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
|
|||
|
||||
if (changed != -1)
|
||||
{
|
||||
if (changed>= E_COLOR_COMPONENT_H)
|
||||
if (changed >= E_COLOR_COMPONENT_H)
|
||||
e_color_update_hsv(wd->cv);
|
||||
else if (changed >= E_COLOR_COMPONENT_R)
|
||||
e_color_update_rgb(wd->cv);
|
||||
|
@ -147,18 +152,23 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
|
|||
case E_COLOR_COMPONENT_R:
|
||||
snprintf(buf, 10, "%i", wd->cv->r);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_G:
|
||||
snprintf(buf, 10, "%i", wd->cv->g);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_B:
|
||||
snprintf(buf, 10, "%i", wd->cv->b);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_H:
|
||||
snprintf(buf, 10, "%.0f", wd->cv->h);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_S:
|
||||
snprintf(buf, 10, "%.2f", wd->cv->s);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_V:
|
||||
snprintf(buf, 10, "%.2f", wd->cv->v);
|
||||
break;
|
||||
|
@ -214,18 +224,23 @@ e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled)
|
|||
case E_COLOR_COMPONENT_R:
|
||||
snprintf(wd->values[i], 10, "%i", wd->cv->r);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_G:
|
||||
snprintf(wd->values[i], 10, "%i", wd->cv->g);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_B:
|
||||
snprintf(wd->values[i], 10, "%i", wd->cv->b);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_H:
|
||||
snprintf(wd->values[i], 10, "%.0f", wd->cv->h);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_S:
|
||||
snprintf(wd->values[i], 10, "%.2f", wd->cv->s);
|
||||
break;
|
||||
|
||||
case E_COLOR_COMPONENT_V:
|
||||
snprintf(wd->values[i], 10, "%.2f", wd->cv->v);
|
||||
break;
|
||||
|
@ -287,3 +302,4 @@ e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled)
|
|||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue