nightshade-api 0.41.0

Procedural high level API for the nightshade game engine
Documentation
//! Color constants and constructors. Colors everywhere in this crate are
//! plain `[f32; 4]` linear RGBA.

pub const WHITE: [f32; 4] = [1.0, 1.0, 1.0, 1.0];
pub const BLACK: [f32; 4] = [0.0, 0.0, 0.0, 1.0];
pub const GRAY: [f32; 4] = [0.5, 0.5, 0.5, 1.0];
pub const STEEL: [f32; 4] = [0.45, 0.5, 0.6, 1.0];
pub const RED: [f32; 4] = [0.85, 0.15, 0.15, 1.0];
pub const ORANGE: [f32; 4] = [0.95, 0.5, 0.1, 1.0];
pub const GOLD: [f32; 4] = [1.0, 0.85, 0.2, 1.0];
pub const YELLOW: [f32; 4] = [0.95, 0.9, 0.2, 1.0];
pub const GREEN: [f32; 4] = [0.2, 0.7, 0.3, 1.0];
pub const TEAL: [f32; 4] = [0.1, 0.65, 0.65, 1.0];
pub const BLUE: [f32; 4] = [0.2, 0.45, 0.9, 1.0];
pub const PURPLE: [f32; 4] = [0.55, 0.25, 0.8, 1.0];
pub const PINK: [f32; 4] = [0.95, 0.45, 0.7, 1.0];

/// An opaque color from red, green, and blue components in 0.0 to 1.0.
pub const fn rgb(red: f32, green: f32, blue: f32) -> [f32; 4] {
    [red, green, blue, 1.0]
}

/// A color with an explicit alpha component.
pub const fn rgba(red: f32, green: f32, blue: f32, alpha: f32) -> [f32; 4] {
    [red, green, blue, alpha]
}