Skip to content

Commit e41de53

Browse files
committed
Merge branch 'main' into advanced_shader
2 parents b0bb8b4 + 94ed750 commit e41de53

File tree

3 files changed

+259
-131
lines changed

3 files changed

+259
-131
lines changed

crates/bevy_ui_render/src/gradient.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ fn convert_color_to_space(color: LinearRgba, space: InterpolationColorSpace) ->
665665
[
666666
oklcha.lightness,
667667
oklcha.chroma,
668-
oklcha.hue.to_radians(),
668+
// The shader expects normalized hues
669+
oklcha.hue / 360.,
669670
oklcha.alpha,
670671
]
671672
}
@@ -676,18 +677,13 @@ fn convert_color_to_space(color: LinearRgba, space: InterpolationColorSpace) ->
676677
InterpolationColorSpace::LinearRgba => color.to_f32_array(),
677678
InterpolationColorSpace::Hsla | InterpolationColorSpace::HslaLong => {
678679
let hsla: Hsla = color.into();
679-
// Normalize hue to 0..1 range for shader
680-
[
681-
hsla.hue / 360.0,
682-
hsla.saturation,
683-
hsla.lightness,
684-
hsla.alpha,
685-
]
680+
// The shader expects normalized hues
681+
[hsla.hue / 360., hsla.saturation, hsla.lightness, hsla.alpha]
686682
}
687683
InterpolationColorSpace::Hsva | InterpolationColorSpace::HsvaLong => {
688684
let hsva: Hsva = color.into();
689-
// Normalize hue to 0..1 range for shader
690-
[hsva.hue / 360.0, hsva.saturation, hsva.value, hsva.alpha]
685+
// The shader expects normalized hues
686+
[hsva.hue / 360., hsva.saturation, hsva.value, hsva.alpha]
691687
}
692688
}
693689
}

0 commit comments

Comments
 (0)