mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 07:48:12 +08:00
Fix Levels Node (#1289)
The Levels Node was previously outputing channel values out side the range of 0..1, this should be fixed now
This commit is contained in:
@@ -261,7 +261,7 @@ fn levels_node(color: Color, input_start: f64, input_mid: f64, input_end: f64, o
|
|||||||
|
|
||||||
// Input levels (Range: 0-1)
|
// Input levels (Range: 0-1)
|
||||||
let highlights_minus_shadows = (input_highlights - input_shadows).max(f32::EPSILON).min(1.);
|
let highlights_minus_shadows = (input_highlights - input_shadows).max(f32::EPSILON).min(1.);
|
||||||
let color = color.map_rgb(|c| (c - input_shadows).max(0.) / highlights_minus_shadows);
|
let color = color.map_rgb(|c| ((c - input_shadows).max(0.) / highlights_minus_shadows).min(1.));
|
||||||
|
|
||||||
// Midtones (Range: 0-1)
|
// Midtones (Range: 0-1)
|
||||||
let color = color.gamma(gamma);
|
let color = color.gamma(gamma);
|
||||||
|
|||||||
Reference in New Issue
Block a user