Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-08-25 11:49:12 +0400
committerMatt Ebb <matt@mke3.net>2010-08-25 11:49:12 +0400
commit0066e337683c9b78ff3a62e1caed004d07fe4803 (patch)
treea01f4334bc957aefabae879ffd8e2c5aa33d8fad
parent75c176f56eff800797011c3c805d5669eb758f2b (diff)
Fix: Colour picker wheel wasn't gamma corrected - drawing too dark
-rw-r--r--source/blender/editors/interface/interface_widgets.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6b7d88d3c28..32ede75c20d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1638,6 +1638,10 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
float centx, centy, radius;
float rgb[3], hsv[3], hsvo[3], col[3], colcent[3];
int a, tot= 32;
+ int color_profile = but->block->color_profile;
+
+ if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
+ color_profile = BLI_PR_NONE;
radstep= 2.0f*M_PI/(float)tot;
centx= (float)(rect->xmin + rect->xmax)/2;
@@ -1656,7 +1660,10 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
/* 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)
+ hsv[2] = 1.f;
+ else if (color_profile)
+ hsv[2] = linearrgb_to_srgb(hsv[2]);
hsv_to_rgb(0.f, 0.f, hsv[2], colcent, colcent+1, colcent+2);
@@ -1884,11 +1891,8 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
float rgb[3], hsv[3], v, range;
int color_profile = but->block->color_profile;
- if (but->rnaprop) {
- if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
- color_profile = BLI_PR_NONE;
- }
- }
+ if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
+ color_profile = BLI_PR_NONE;
ui_get_but_vectorf(but, rgb);
rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);