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:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-18 03:08:24 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-18 03:08:36 +0400
commit06de5be90e8b009c53b6fe3225085fcd4375f21f (patch)
treec7eaf7391cebf1cb7d9e959c4913048025f9304d /source/blender/blenlib/intern/math_color.c
parent7da21752716a0e9e6e6ad8ccbda20fb1c5e8e123 (diff)
Fix T39228 Gamma/lift/gain are burned out in the circular color pickers
and value/lightness slider stops midway. Issue here is manyfold: Color wheel does not support properties with different soft min/max values than 1.0 (which after experimenting a little I left as is), and also color management is completely destroying the mapping between the value slider and the RNA property value range. To solve this I have disabled color management by setting the property to gamma corrected (only in RNA, Sequence editor coders please check!), otherwise it will just become a big mess of tracking where color comes from and what kind of color transforms it needs in different color pickers (if property has non normalized range etc). HSL is not really meant to represent colors outside a normalized space so I have disabled setting lightness above 1.0 in this model. This will work, however it is hacking a color picker to do something other than what it is supposed to do: pick a color from the screen accurately. Which means normalized values always. The non normalized colors picked for lift/gain/gamma through the pickers do not correspond to any accurate colors; they are rather a user friendly way to 'sort of' choose a color and a gamma with an indication of maximum value. I think that lift/gamma/gain nodes need a dedicated widget for this (besides it is quite clear that some options are written for that use case) -or- a separate gamma multiplier for the picked color (which should itself be in a normalized space)
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r--source/blender/blenlib/intern/math_color.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 093b82e9126..61d55c720b0 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -349,7 +349,7 @@ void rgb_to_hsl(float r, float g, float b, float *lh, float *ls, float *ll)
{
const float cmax = max_fff(r, g, b);
const float cmin = min_fff(r, g, b);
- float h, s, l = (cmax + cmin) / 2.0f;
+ float h, s, l = min_ff(1.0, (cmax + cmin) / 2.0f);
if (cmax == cmin) {
h = s = 0.0f; // achromatic