rsgt 0.2.1

Rust simple GUI Toolkit
//========================================================================
// RSGT | wgpu/mod.rs - https://overtimecoder.github.io
//------------------------------------------------------------------------
// wgpu utility for RSGT
//------------------------------------------------------------------------
//
// Author LatteS
//
// File was created in 2023/01/07
//
//========================================================================

use crate::theme::ComponentColor;

pub fn parse_color(color:ComponentColor) -> wgpu::Color {
    match color {
        ComponentColor::White => {wgpu::Color::WHITE}
        ComponentColor::WhiteGray => {wgpu::Color{r:0.85,g:0.85,b:0.85,a:1.0}}
        ComponentColor::Gray => {wgpu::Color{r:0.5,g:0.5,b:0.5,a:1.0}}
        ComponentColor::Black => {wgpu::Color::BLACK}
        ComponentColor::Red => {wgpu::Color::RED}
        ComponentColor::Green => {wgpu::Color::GREEN}
        ComponentColor::Blue => {wgpu::Color::BLUE}
        ComponentColor::CustomColor(r, g, b, a) => {wgpu::Color {r,g,b,a}}

    }
}