diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2025-03-02 17:16:52 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2025-03-02 17:16:52 +0700 |
commit | 5c1dc80be89fe8864275e45feda2fb65e2b575da (patch) | |
tree | c1ec1e633cdc12a70898c8cec37bb465d1e59c25 /src/common.rs | |
parent | 93b24b9d01f806cf69ecee86fada9e5b9bf06182 (diff) |
fix recursion
Diffstat (limited to 'src/common.rs')
-rw-r--r-- | src/common.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.rs b/src/common.rs index a676939..918c59c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -46,6 +46,14 @@ impl Color { } } + pub fn elem_prod(&self, other: &Self) -> Self { + Self { + r: self.r * other.r, + g: self.g * other.g, + b: self.b * other.b, + } + } + fn _linear_to_gamma(linear_comp: f32) -> f32 { if linear_comp > 0.0 { linear_comp.sqrt() } else { 0.0 } } |