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-09-18 14:20:34 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-09-18 14:20:34 +0400
commit44121442e97496963a13a80a3d96c24d8b38392f (patch)
tree6e15f7a5e67953a842dab8908b3177f4ed471a35 /source/blender
parentb247e19ff10c74c756ec94b3d4f910383190f172 (diff)
Palette active color:
Use indicator color derived from color luminance for better contrast.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_widgets.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index ff46925edaa..0ffd45e2f50 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2901,8 +2901,15 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
if (but->a1 == UI_PALETTE_COLOR && but->a2 == UI_PALETTE_COLOR_ACTIVE) {
float width = rect->xmax - rect->xmin;
float height = rect->ymax - rect->ymin;
-
- glColor4ubv((unsigned char *)wcol->outline);
+ /* find color luminance and change it slightly */
+ float bw = rgb_to_bw(col);
+
+ if (bw > 0.5)
+ bw -= 0.5;
+ else
+ bw += 0.5;
+
+ glColor4f(bw, bw, bw, 1.0);
glBegin(GL_TRIANGLES);
glVertex2f(rect->xmin + 0.1f * width, rect->ymin + 0.9f * height);
glVertex2f(rect->xmin + 0.1f * width, rect->ymin + 0.5f * height);