//! Visual theme with lightsaber color palette.
use eframe::egui::Color32;
/// Theme with lightsaber-inspired colors.
#[derive(Clone, Debug)]
pub struct VoiceModeTheme {
/// Primary color - listening state (Lapis Lazuli blue)
pub lapis_lazuli: Color32,
/// Accent color - processing state (Mace Windu purple)
pub mace_windu: Color32,
/// Success color - speaking state (Emerald green)
pub emerald: Color32,
/// Warning color (Burnt orange)
pub burnt_orange: Color32,
/// Error color (Sith red)
pub sith_red: Color32,
/// Background color (dark titanium)
pub background: Color32,
/// Surface color (forged carbon)
pub surface: Color32,
/// Secondary surface (woven carbon)
pub surface_alt: Color32,
/// Primary text color
pub text: Color32,
/// Muted text color
pub text_muted: Color32,
/// Glow intensity for bloom shader (0.0 - 2.0)
pub glow_intensity: f32,
/// Glow radius in pixels
pub glow_radius: f32,
}
impl Default for VoiceModeTheme {
fn default() -> Self {
Self {
// Lightsaber colors
lapis_lazuli: Color32::from_rgb(38, 89, 165), // #2659A5 - blue
mace_windu: Color32::from_rgb(128, 51, 204), // #8033CC - purple
emerald: Color32::from_rgb(51, 178, 77), // #33B24D - green
burnt_orange: Color32::from_rgb(204, 102, 26), // #CC661A - orange
sith_red: Color32::from_rgb(230, 26, 26), // #E61A1A - red
// Surface colors (dark metallic)
background: Color32::from_rgb(12, 14, 16), // Near black
surface: Color32::from_rgb(22, 26, 30), // Forged carbon dark
surface_alt: Color32::from_rgb(32, 38, 44), // Woven carbon lighter
// Text
text: Color32::from_rgb(220, 225, 230),
text_muted: Color32::from_rgb(140, 150, 160),
// Glow settings
glow_intensity: 1.5,
glow_radius: 8.0,
}
}
}
impl VoiceModeTheme {
/// Get the current state color based on app state.
pub fn state_color(&self, is_recording: bool, is_speaking: bool, is_error: bool) -> Color32 {
if is_error {
self.sith_red
} else if is_speaking {
self.emerald
} else if is_recording {
self.mace_windu
} else {
self.lapis_lazuli
}
}
/// Get a lighter version of a color for glow core.
pub fn glow_core(&self, color: Color32) -> Color32 {
Color32::from_rgba_unmultiplied(
color.r().saturating_add(60),
color.g().saturating_add(60),
color.b().saturating_add(60),
255,
)
}
/// Get a darker version for glow edge.
pub fn glow_edge(&self, color: Color32) -> Color32 {
Color32::from_rgba_unmultiplied(
color.r() / 3,
color.g() / 3,
color.b() / 3,
128,
)
}
}