Skip to content

Commit 930d3b0

Browse files
committed
Use linear RGB for vertex colors.
1 parent 6dab4e5 commit 930d3b0

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

crates/processing_render/src/render/mesh_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a> MeshBuilder<'a> {
3636
if let Some(VertexAttributeValues::Float32x4(colors)) =
3737
self.mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
3838
{
39-
colors.push(self.color.to_srgba().to_f32_array());
39+
colors.push(self.color.to_linear().to_f32_array());
4040
}
4141

4242
if let Some(VertexAttributeValues::Float32x3(normals)) =

crates/processing_render/src/render/primitive/quad.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn simple_quad(
7070
if let Some(VertexAttributeValues::Float32x4(colors)) =
7171
mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
7272
{
73-
let color_array = color.to_srgba().to_f32_array();
73+
let color_array = color.to_linear().to_f32_array();
7474
for _ in 0..4 {
7575
colors.push(color_array);
7676
}

crates/processing_render/src/render/primitive/rect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn simple_rect(mesh: &mut Mesh, x: f32, y: f32, w: f32, h: f32, color: Color) {
8787
if let Some(VertexAttributeValues::Float32x4(colors)) =
8888
mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
8989
{
90-
let color_array = color.to_srgba().to_f32_array();
90+
let color_array = color.to_linear().to_f32_array();
9191
for _ in 0..4 {
9292
colors.push(color_array);
9393
}

crates/processing_render/src/render/primitive/shape.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ fn push_triangle(
497497
positions.push([x3, y3, 0.0]);
498498
}
499499

500-
let color_array = color.to_srgba().to_f32_array();
500+
let color_array = color.to_linear().to_f32_array();
501501
if let Some(VertexAttributeValues::Float32x4(colors)) =
502502
mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
503503
{
@@ -556,7 +556,7 @@ fn push_quad(
556556
positions.push([x4, y4, 0.0]);
557557
}
558558

559-
let color_array = color.to_srgba().to_f32_array();
559+
let color_array = color.to_linear().to_f32_array();
560560
if let Some(VertexAttributeValues::Float32x4(colors)) =
561561
mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
562562
{

crates/processing_render/src/render/primitive/triangle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn simple_triangle(
6464
if let Some(VertexAttributeValues::Float32x4(colors)) =
6565
mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR)
6666
{
67-
let color_array = color.to_srgba().to_f32_array();
67+
let color_array = color.to_linear().to_f32_array();
6868
for _ in 0..3 {
6969
colors.push(color_array);
7070
}

0 commit comments

Comments
 (0)