From 5c1dc80be89fe8864275e45feda2fb65e2b575da Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Sun, 2 Mar 2025 17:16:52 +0700 Subject: fix recursion --- src/common.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/common.rs') 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 } } -- cgit v1.2.3-70-g09d2