aboutsummaryrefslogtreecommitdiff
path: root/src/texture/solid_color.rs
blob: 3af46cab6082769764e848d59aa226ce2965e166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::Texture;
use crate::{vec3::Color, vec3::Point3};

pub struct SolidColor {
    pub color_value: Color,
}

impl SolidColor {
    pub fn from_color(color_value: Color) -> Self {
        Self {
            color_value,
        }
    }
}

impl Texture for SolidColor {
    fn value(&self, _: f64, _: f64, _: &Point3) -> Color {
        self.color_value.clone()
    }
}