Color picker fixes... (bug #1490)

Since color is stored RGB only in Blender, the conversion from and to HSV
causes values to be clipped all the time.
Solution found is adding a persistant hsv storage to the uiBut struct, and
have it working on that only while hsv button is open. Still, after usage
(leaving picker) the conversion will change values to rgb.

Also added; redraw event for editing buttons, to show correct changed
color while using nkey picker
This commit is contained in:
2004-10-14 14:20:24 +00:00
parent 0d68cafdec
commit 6fbd4e3e1f
6 changed files with 80 additions and 69 deletions

View File

@@ -1554,13 +1554,14 @@ static void ui_draw_but_COL(uiBut *but)
static void ui_draw_but_HSVCUBE(uiBut *but)
{
int a;
float col[3], h,s,v;
float h,s,v;
float dx, dy, sx1, sx2, sy, x, y;
float col0[4][3]; // left half, rect bottom to top
float col1[4][3]; // right half, rect bottom to top
ui_get_but_vectorf(but, col);
rgb_to_hsv(col[0], col[1], col[2], &h, &s, &v);
h= but->hsv[0];
s= but->hsv[1];
v= but->hsv[2];
/* draw series of gouraud rects */
glShadeModel(GL_SMOOTH);