@@ -33,11 +33,15 @@ uniform float hsvGamma<
33
33
float step = 0.01 ;
34
34
> = 1.0 ;
35
35
36
- uniform float adjustmentOrder<
36
+ uniform int adjustmentOrder<
37
37
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";
41
45
> = 1 ;
42
46
43
47
// HSV conversion
@@ -108,7 +112,7 @@ float3 hsl2rgb(float3 c) {
108
112
}
109
113
110
114
float3 adjustColorWithOrder(float3 originalColor) {
111
- if (adjustmentOrder == 1.0 ) {
115
+ if (adjustmentOrder == 1 ) {
112
116
// Parallel adjustment (both HSL and HSV operate on the original image and then blend)
113
117
float3 hslAdjusted = rgb2hsl(originalColor);
114
118
hslAdjusted.y = pow (hslAdjusted.y, (1 / hslGamma));
@@ -123,7 +127,7 @@ float3 adjustColorWithOrder(float3 originalColor) {
123
127
float3 finalColor = (hslAdjustedColor + hsvAdjustedColor) * 0.5 ;
124
128
return finalColor;
125
129
}
126
- else if (adjustmentOrder == 2.0 ) {
130
+ else if (adjustmentOrder == 2 ) {
127
131
// HSL first, then HSV
128
132
float3 hslAdjusted = rgb2hsl(originalColor);
129
133
hslAdjusted.y = pow (hslAdjusted.y, (1 / hslGamma));
@@ -134,7 +138,7 @@ float3 adjustColorWithOrder(float3 originalColor) {
134
138
hsvAdjusted.y *= hsvSaturationFactor;
135
139
return hsv2rgb(hsvAdjusted);
136
140
}
137
- else if (adjustmentOrder == 3.0 ) {
141
+ else if (adjustmentOrder == 3 ) {
138
142
// HSV first, then HSL
139
143
float3 hsvAdjusted = rgb2hsv(originalColor);
140
144
hsvAdjusted.y = pow (hsvAdjusted.y, (1 / hsvGamma));
0 commit comments