Skip to content

Commit 585fb66

Browse files
committed
hsl_hsv_saturation.shader order dropdown
1 parent e462537 commit 585fb66

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

data/examples/hsl_hsv_saturation.shader

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ uniform float hsvGamma<
3333
float step = 0.01;
3434
> = 1.0;
3535

36-
uniform float adjustmentOrder<
36+
uniform int adjustmentOrder<
3737
string label = "Order";
38-
float minimum = 1;
39-
float maximum = 3;
40-
float step = 1;
38+
string widget_type = "select";
39+
int option_0_value = 1;
40+
string option_0_label = "Parallel adjustment (both HSL and HSV operate on the original image and then blend)";
41+
int option_1_value = 2;
42+
string option_1_label = "HSL first, then HSV";
43+
int option_2_value = 3;
44+
string option_2_label = "HSV first, then HSL";
4145
> = 1;
4246

4347
// HSV conversion
@@ -108,7 +112,7 @@ float3 hsl2rgb(float3 c) {
108112
}
109113

110114
float3 adjustColorWithOrder(float3 originalColor) {
111-
if (adjustmentOrder == 1.0) {
115+
if (adjustmentOrder == 1) {
112116
// Parallel adjustment (both HSL and HSV operate on the original image and then blend)
113117
float3 hslAdjusted = rgb2hsl(originalColor);
114118
hslAdjusted.y = pow(hslAdjusted.y, (1/hslGamma));
@@ -123,7 +127,7 @@ float3 adjustColorWithOrder(float3 originalColor) {
123127
float3 finalColor = (hslAdjustedColor + hsvAdjustedColor) * 0.5;
124128
return finalColor;
125129
}
126-
else if (adjustmentOrder == 2.0) {
130+
else if (adjustmentOrder == 2) {
127131
// HSL first, then HSV
128132
float3 hslAdjusted = rgb2hsl(originalColor);
129133
hslAdjusted.y = pow(hslAdjusted.y, (1/hslGamma));
@@ -134,7 +138,7 @@ float3 adjustColorWithOrder(float3 originalColor) {
134138
hsvAdjusted.y *= hsvSaturationFactor;
135139
return hsv2rgb(hsvAdjusted);
136140
}
137-
else if (adjustmentOrder == 3.0) {
141+
else if (adjustmentOrder == 3) {
138142
// HSV first, then HSL
139143
float3 hsvAdjusted = rgb2hsv(originalColor);
140144
hsvAdjusted.y = pow(hsvAdjusted.y, (1/hsvGamma));

0 commit comments

Comments
 (0)