summaryrefslogtreecommitdiffstats
path: root/wgpu/src/triangle
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 04:37:23 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 04:37:23 +0100
commit62465842099908f9e50b8edabfec709b37b1ade3 (patch)
treeb304761c0b9afce34a1294a3ac93155a59289722 /wgpu/src/triangle
parentb95745340441835bd25b5cadc2342254631f8c05 (diff)
downloadiced-62465842099908f9e50b8edabfec709b37b1ade3.tar.gz
iced-62465842099908f9e50b8edabfec709b37b1ade3.tar.bz2
iced-62465842099908f9e50b8edabfec709b37b1ade3.zip
Convert colors to linear RGB before uploading in `solid` pipelines
Diffstat (limited to 'wgpu/src/triangle')
-rw-r--r--wgpu/src/triangle/solid.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/wgpu/src/triangle/solid.rs b/wgpu/src/triangle/solid.rs
index 0373ebee..75455310 100644
--- a/wgpu/src/triangle/solid.rs
+++ b/wgpu/src/triangle/solid.rs
@@ -20,9 +20,11 @@ pub(super) struct Uniforms {
impl Uniforms {
pub fn new(transform: Transformation, color: Color) -> Self {
+ let [r, g, b, a] = color.into_linear();
+
Self {
transform: transform.into(),
- color: Vec4::new(color.r, color.g, color.b, color.a),
+ color: Vec4::new(r, g, b, a),
}
}
}