summaryrefslogblamecommitdiffstats
path: root/graphics/src/shader.rs
blob: 69679e9bfc11d40fda207b4ab781ffcdd8c2b454 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

                      
                 
                              









                                                    
                                     

                             
                                         




                                                          
//! Supported shaders;

use crate::Color;
use crate::gradient::Gradient;

#[derive(Debug, Clone)]
/// Supported shaders for primitives.
pub enum Shader {
    /// Fill a primitive with a solid color.
    Solid(Color),
    /// Fill a primitive with an interpolated color.
    Gradient(Gradient)
}

impl <'a> Into<Shader> for Gradient {
    fn into(self) -> Shader {
        match self {
            Gradient::Linear(linear) => {
                Shader::Gradient(Gradient::Linear(linear))
            }
        }
    }
}