diff options
| author | HampusM <hampus@hampusmat.com> | 2026-08-19 22:56:49 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-08-19 22:56:49 +0200 |
| commit | f93ea96df00f31416589e5e5a09debf10d5a4bba (patch) | |
| tree | 98cc47a2a5fafba33cce02271bdec3bb0aa9608f /engine/src/rendering/shader/cursor.rs | |
| parent | e7f503a1e545aa83535e67eceafb0462780bfc2d (diff) | |
feat(engine): lossily convert color shader bindings to rgb
Diffstat (limited to 'engine/src/rendering/shader/cursor.rs')
| -rw-r--r-- | engine/src/rendering/shader/cursor.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/engine/src/rendering/shader/cursor.rs b/engine/src/rendering/shader/cursor.rs index 82b5ec0..49f6b47 100644 --- a/engine/src/rendering/shader/cursor.rs +++ b/engine/src/rendering/shader/cursor.rs @@ -4,7 +4,7 @@ use std::hint::cold_path; use circular_buffer::FixedCircularBuffer; -use crate::color::Color; +use crate::color::{Color, Rgb, Rgba}; use crate::data_types::matrix::Matrix; use crate::data_types::vector::Vec3; use crate::rendering::object::Id as RenderingObjectId; @@ -319,6 +319,21 @@ impl From<Color<f32>> for BindingValue BindingValue::Color(color) } } +impl From<Rgb<f32>> for BindingValue +{ + fn from(color: Rgb<f32>) -> Self + { + BindingValue::Color(color.into()) + } +} + +impl From<Rgba<f32>> for BindingValue +{ + fn from(color: Rgba<f32>) -> Self + { + BindingValue::Color(color.into()) + } +} impl From<Matrix<f32, 4, 4>> for BindingValue { |
