Skip to content

Commit 32e0c93

Browse files
committed
shaders: use unchecked Color constructors
1 parent d2d27a6 commit 32e0c93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

node-graph/graster-nodes/src/adjustments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn make_opaque<T: Adjust<Color>>(
127127
if color.a() == 0. {
128128
return color.with_alpha(1.);
129129
}
130-
Color::from_rgbaf32(color.r() / color.a(), color.g() / color.a(), color.b() / color.a(), 1.).unwrap()
130+
Color::from_rgbaf32_unchecked(color.r() / color.a(), color.g() / color.a(), color.b() / color.a(), 1.)
131131
});
132132
input
133133
}
@@ -359,7 +359,7 @@ fn black_and_white<T: Adjust<Color>>(
359359
// TODO: Fix "Color" blend mode implementation so it matches the expected behavior perfectly (it's currently close)
360360
let color = tint.with_luminance(luminance);
361361

362-
let color = Color::from_rgbaf32(color.r(), color.g(), color.b(), alpha_part).unwrap();
362+
let color = Color::from_rgbaf32_unchecked(color.r(), color.g(), color.b(), alpha_part);
363363

364364
color.to_linear_srgb()
365365
});

0 commit comments

Comments
 (0)