pub use bevy_color::{Alpha, Color, Mix};
use bevy_color::ColorToComponents;
pub fn linear_rgba(color: Color) -> [f32; 4] {
color.to_linear().to_f32_array()
}
pub fn wgpu_color(color: Color) -> wgpu::Color {
let c = color.to_linear();
wgpu::Color {
r: c.red as f64,
g: c.green as f64,
b: c.blue as f64,
a: c.alpha as f64,
}
}
pub fn yakui_color(color: Color) -> yakui::geometry::Color {
let c = color.to_srgba();
let channel = |value: f32| (value.clamp(0.0, 1.0) * 255.0).round() as u8;
yakui::geometry::Color::rgba(
channel(c.red),
channel(c.green),
channel(c.blue),
channel(c.alpha),
)
}