diff options
| author | HampusM <hampus@hampusmat.com> | 2026-07-17 03:06:04 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-07-17 03:06:04 +0200 |
| commit | 65e24308babb2ed4f33fb6f1d7b531df676bd70d (patch) | |
| tree | df9477d4b805cc6866a086833d6118505804dd3a /engine/src/material.rs | |
| parent | 649d4d4ab2f54ca12f75d2cba50e1adef2350dbe (diff) | |
refactor(engine): change Color struct into a enum
Diffstat (limited to 'engine/src/material.rs')
| -rw-r--r-- | engine/src/material.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engine/src/material.rs b/engine/src/material.rs index 42a9884..dd5a460 100644 --- a/engine/src/material.rs +++ b/engine/src/material.rs @@ -1,6 +1,6 @@ use crate::asset::Handle as AssetHandle; use crate::builder; -use crate::color::Color; +use crate::color::{Color, Rgb}; use crate::ecs::Component; use crate::reflection::Reflection; use crate::texture::Texture; @@ -22,7 +22,7 @@ pub struct Material impl Material { - pub const fn builder() -> Builder + pub fn builder() -> Builder { Builder::new() } @@ -52,12 +52,12 @@ pub struct Builder impl Builder { #[must_use] - pub const fn new() -> Self + pub fn new() -> Self { Self { - ambient: Color::WHITE_F32, - diffuse: Color::WHITE_F32, - specular: Color::WHITE_F32, + ambient: Color::Rgb(Rgb::<f32>::white()), + diffuse: Color::Rgb(Rgb::<f32>::white()), + specular: Color::Rgb(Rgb::<f32>::white()), ambient_map: None, diffuse_map: None, specular_map: None, |
