diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-03-18 03:33:28 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-03-18 03:33:28 +0400 |
commit | 4d44f70d5ff7f4948be85f67f2d88e9df799b532 (patch) | |
tree | 8a5108d7a60086b17cbd06b182f51c2aa1e9dc27 /source/blender/editors/interface | |
parent | 06de5be90e8b009c53b6fe3225085fcd4375f21f (diff) |
Follow up to previous commit:
Make HSL wheel useful in compositing.
In HSL, 0.5 lightness corresponds to most vibrant colors so make that
default for locked wheels (previous value of 1.0 just made it white).
Also, unlock the wheel for both very bright and very dark colors.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 20 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 8 |
2 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 03c19f5e94b..d0cc2f1ceaa 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4638,8 +4638,14 @@ static bool ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ - if (but->flag & UI_BUT_COLOR_LOCK) { // lock - if (hsv[2] == 0.f) hsv[2] = 0.0001f; + if (but->flag & UI_BUT_COLOR_LOCK) { + if (U.color_picker_type == USER_CP_CIRCLE_HSV) { // lock + if (hsv[2] == 0.f) hsv[2] = 0.0001f; + } + else { + if (hsv[2] == 0.f) hsv[2] = 0.0001f; + if (hsv[2] == 1.f) hsv[2] = 0.9999f; + } } /* only apply the delta motion, not absolute */ @@ -4727,8 +4733,14 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ - if (but->flag & UI_BUT_COLOR_LOCK) { // lock - if (hsv[2] == 0.0f) hsv[2] = 0.0001f; + if (but->flag & UI_BUT_COLOR_LOCK) { + if (U.color_picker_type == USER_CP_CIRCLE_HSV) { // lock + if (hsv[2] == 0.f) hsv[2] = 0.0001f; + } + else { + if (hsv[2] == 0.f) hsv[2] = 0.0001f; + if (hsv[2] == 1.f) hsv[2] = 0.9999f; + } } if (snap != SNAP_OFF) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 2eff3a359ba..9eb39f67831 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2071,8 +2071,12 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * /* exception: if 'lock' is set * lock the value of the color wheel to 1. * Useful for color correction tools where you're only interested in hue. */ - if (but->flag & UI_BUT_COLOR_LOCK) - hsv[2] = 1.f; + if (but->flag & UI_BUT_COLOR_LOCK) { + if(U.color_picker_type == USER_CP_CIRCLE_HSV) + hsv[2] = 1.f; + else + hsv[2] = 0.5f; + } ui_color_picker_to_rgb(0.f, 0.f, hsv[2], colcent, colcent + 1, colcent + 2); |