diff --git a/scene/gui/color_mode.cpp b/scene/gui/color_mode.cpp index eb3abfef07..ff25aeb721 100644 --- a/scene/gui/color_mode.cpp +++ b/scene/gui/color_mode.cpp @@ -47,8 +47,7 @@ String ColorModeRGB::get_slider_label(int idx) const { float ColorModeRGB::get_slider_max(int idx) const { ERR_FAIL_INDEX_V_MSG(idx, 4, 0, "Couldn't get slider max value."); - Color color = color_picker->get_pick_color(); - return next_power_of_2(MAX(255, color.components[idx] * 255.0)) - 1; + return slider_max[idx]; } float ColorModeRGB::get_slider_value(int idx) const { diff --git a/scene/gui/color_mode.h b/scene/gui/color_mode.h index 26d2e56e76..3ca2b6bcbc 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -89,6 +89,7 @@ class ColorModeHSV : public ColorMode { class ColorModeRGB : public ColorMode { public: String labels[3] = { "R", "G", "B" }; + float slider_max[4] = { 255, 255, 255, 255 }; virtual String get_name() const override { return "RGB"; } @@ -108,12 +109,11 @@ class ColorModeRGB : public ColorMode { class ColorModeRAW : public ColorMode { public: String labels[3] = { "R", "G", "B" }; - float slider_max[4] = { 100, 100, 100, 1 }; + float slider_max[4] = { 1, 1, 1, 1 }; virtual String get_name() const override { return "RAW"; } - virtual float get_slider_step() const override { return 0.001; } - virtual float get_spinbox_arrow_step() const override { return 0.01; } + virtual float get_slider_step() const override { return 1.0 / 255.0; } virtual String get_slider_label(int idx) const override; virtual float get_slider_max(int idx) const override; virtual float get_slider_value(int idx) const override;