summaryrefslogtreecommitdiff
path: root/src/common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.rs')
-rw-r--r--src/common.rs8
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 }
}