Skip to content

Commit

Permalink
Keep Hue value when Saturation or Value is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
gongpha committed Feb 19, 2021
1 parent aaaaaf5 commit 2774971
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,13 @@ void ColorPicker::_value_changed(double) {
}

if (hsv_mode_enabled) {
color.set_hsv(scroll[0]->get_value() / 360.0,
scroll[1]->get_value() / 100.0,
scroll[2]->get_value() / 100.0,
scroll[3]->get_value() / 255.0);
h = scroll[0]->get_value() / 360.0;
s = scroll[1]->get_value() / 100.0;
v = scroll[2]->get_value() / 100.0;
color.set_hsv(h, s, v, scroll[3]->get_value() / 255.0);

last_hsv = color;

} else {
for (int i = 0; i < 4; i++) {
color.components[i] = scroll[i]->get_value() / (raw_mode_enabled ? 1.0 : 255.0);
Expand Down

0 comments on commit 2774971

Please sign in to comment.