![]() # Objective The false and true arguments for the select statement in `lerp_hue_long` are misordered, resulting in it taking the wrong hue path:  ## Solution Swap the arguments around. Also fixed another case I found during testing. The hue was interpolated even when it is undefined for one of the endpoints (for example in a gradient from black to yellow). In those cases it shouldn't interpolate, instead it should return the hue of the other end point. ## Testing I added a `linear_gradient` module to the testbed `ui` example, run with: ``` cargo run --example testbed_ui ``` In the linear gradients screen (press space to switch) it shows a column of red to yellow linear gradients. The last gradient in the column uses the OKLCH long path, which should look like this:  matching the same gradient in CSS: https://jsfiddle.net/fevshkdy/14/ if the correct hue path is chosen. |
||
---|---|---|
.. | ||
box_shadow.rs | ||
box_shadow.wgsl | ||
debug_overlay.rs | ||
gradient.rs | ||
gradient.wgsl | ||
lib.rs | ||
pipeline.rs | ||
render_pass.rs | ||
ui_material_pipeline.rs | ||
ui_material.rs | ||
ui_material.wgsl | ||
ui_texture_slice_pipeline.rs | ||
ui_texture_slice.wgsl | ||
ui_vertex_output.wgsl | ||
ui.wgsl |