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/data_types | |
| parent | e7f503a1e545aa83535e67eceafb0462780bfc2d (diff) | |
feat(engine): lossily convert color shader bindings to rgb
Diffstat (limited to 'engine/src/data_types')
| -rw-r--r-- | engine/src/data_types/color.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/src/data_types/color.rs b/engine/src/data_types/color.rs index 9803088..9664507 100644 --- a/engine/src/data_types/color.rs +++ b/engine/src/data_types/color.rs @@ -71,6 +71,22 @@ impl<Component: PixelComponent> Color<Component> } } +impl<Component> From<Rgb<Component>> for Color<Component> +{ + fn from(rgb: Rgb<Component>) -> Self + { + Self::Rgb(rgb) + } +} + +impl<Component> From<Rgba<Component>> for Color<Component> +{ + fn from(rgba: Rgba<Component>) -> Self + { + Self::Rgba(rgba) + } +} + impl<Component: Default> Default for Color<Component> { fn default() -> Self |
