mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-05 15:18:11 +08:00
Fix Levels node gamma correction (#1034)
* Fix Levels Node * Fix the fix --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
63b9b670a1
commit
344f243432
@@ -77,9 +77,9 @@ fn levels_node(color: Color, input_start: f64, input_mid: f64, input_end: f64, o
|
|||||||
|
|
||||||
// Gamma correction
|
// Gamma correction
|
||||||
let gamma = if midtones < 0.5 {
|
let gamma = if midtones < 0.5 {
|
||||||
(1. + (9. * (1. - midtones * 2.))).min(9.99)
|
1. / (1. + (9. * (1. - midtones * 2.))).min(9.99)
|
||||||
} else {
|
} else {
|
||||||
((1. - midtones) * 2.).max(0.01)
|
1. / ((1. - midtones) * 2.).max(0.01)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Input levels
|
// Input levels
|
||||||
|
|||||||
Reference in New Issue
Block a user