Add a separate hue gradient for OKHSL mode
This commit is contained in:
parent
eddaab17ea
commit
f5981ff19d
4 changed files with 6 additions and 1 deletions
|
@ -151,6 +151,9 @@
|
|||
<theme_item name="color_hue" data_type="icon" type="Texture2D">
|
||||
Custom texture for the hue selection slider on the right.
|
||||
</theme_item>
|
||||
<theme_item name="color_okhsl_hue" data_type="icon" type="Texture2D">
|
||||
Custom texture for the H slider in the OKHSL color mode.
|
||||
</theme_item>
|
||||
<theme_item name="expanded_arrow" data_type="icon" type="Texture2D">
|
||||
The icon for color preset drop down menu when expanded.
|
||||
</theme_item>
|
||||
|
|
|
@ -289,7 +289,7 @@ void ColorModeOKHSL::slider_draw(int p_which) {
|
|||
const real_t margin = 16 * color_picker->get_theme_default_base_scale();
|
||||
|
||||
if (p_which == 0) { // H
|
||||
Ref<Texture2D> hue = color_picker->get_theme_icon(SNAME("color_hue"), SNAME("ColorPicker"));
|
||||
Ref<Texture2D> hue = color_picker->get_theme_icon(SNAME("color_okhsl_hue"), SNAME("ColorPicker"));
|
||||
slider->draw_set_transform(Point2(), -Math_PI / 2, Size2(1.0, 1.0));
|
||||
slider->draw_texture_rect(hue, Rect2(Vector2(margin * -1, 0), Vector2(margin, size.x)), false);
|
||||
return;
|
||||
|
|
1
scene/resources/default_theme/color_picker_okhsl_hue.svg
Normal file
1
scene/resources/default_theme/color_picker_okhsl_hue.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 1 256" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientTransform="matrix(0 256 -256 0 0 0)" gradientUnits="userSpaceOnUse" x1="0" x2="1" y1="0" y2="0"><stop offset="0" stop-color="#d70071"/><stop offset=".07142857143" stop-color="#df0020"/><stop offset=".14285714286" stop-color="#b85800"/><stop offset=".21428571429" stop-color="#9e6c00"/><stop offset=".28571428571" stop-color="#857900"/><stop offset=".35714285714" stop-color="#5c8700"/><stop offset=".42857142857" stop-color="#008e4f"/><stop offset=".5" stop-color="#008a79"/><stop offset=".57142857143" stop-color="#008793"/><stop offset=".64285714286" stop-color="#0082ae"/><stop offset=".71428571429" stop-color="#0071eb"/><stop offset=".78571428571" stop-color="#6d50ff"/><stop offset=".85714285714" stop-color="#a801f4"/><stop offset=".92857142857" stop-color="#c600b2"/><stop offset="1" stop-color="#d70071"/></linearGradient><path d="m0 0h1v256h-1z" fill="url(#a)"/></svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -888,6 +888,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
|
|||
theme->set_icon("shape_rect_wheel", "ColorPicker", icons["picker_shape_rectangle_wheel"]);
|
||||
theme->set_icon("add_preset", "ColorPicker", icons["add"]);
|
||||
theme->set_icon("color_hue", "ColorPicker", icons["color_picker_hue"]);
|
||||
theme->set_icon("color_okhsl_hue", "ColorPicker", icons["color_picker_okhsl_hue"]);
|
||||
theme->set_icon("sample_bg", "ColorPicker", icons["mini_checkerboard"]);
|
||||
theme->set_icon("overbright_indicator", "ColorPicker", icons["color_picker_overbright"]);
|
||||
theme->set_icon("bar_arrow", "ColorPicker", icons["color_picker_bar_arrow"]);
|
||||
|
|
Loading…
Reference in a new issue