use super::dtcg::ColorValue;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MacAppearanceColors {
pub window_background: ColorValue,
pub control_background: ColorValue,
pub control: ColorValue,
pub control_accent: ColorValue,
pub selected_control: ColorValue,
pub selected_control_inactive: ColorValue,
pub separator: ColorValue,
pub placeholder_text: ColorValue,
pub keyboard_focus_indicator: ColorValue,
#[serde(default = "default_label_color")]
pub label: ColorValue,
#[serde(default = "default_secondary_label_color")]
pub secondary_label: ColorValue,
#[serde(default = "default_system_green")]
pub system_green: ColorValue,
#[serde(default = "default_system_yellow")]
pub system_yellow: ColorValue,
#[serde(default = "default_system_orange")]
pub system_orange: ColorValue,
#[serde(default = "default_system_red")]
pub system_red: ColorValue,
#[serde(default = "default_alternating_row_even")]
pub alternating_row_even: ColorValue,
#[serde(default = "default_alternating_row_odd")]
pub alternating_row_odd: ColorValue,
#[serde(default = "default_scrubber_selection_border")]
pub scrubber_selection_border: ColorValue,
#[serde(default = "default_scrubber_outside_dim")]
pub scrubber_outside_dim: ColorValue,
#[serde(default = "default_scrubber_waveform")]
pub scrubber_waveform: ColorValue,
#[serde(default = "default_scrubber_playhead")]
pub scrubber_playhead: ColorValue,
#[serde(default = "default_traffic_light_close")]
pub traffic_light_close: ColorValue,
#[serde(default = "default_traffic_light_close_border")]
pub traffic_light_close_border: ColorValue,
#[serde(default = "default_traffic_light_minimize")]
pub traffic_light_minimize: ColorValue,
#[serde(default = "default_traffic_light_minimize_border")]
pub traffic_light_minimize_border: ColorValue,
#[serde(default = "default_traffic_light_zoom")]
pub traffic_light_zoom: ColorValue,
#[serde(default = "default_traffic_light_zoom_border")]
pub traffic_light_zoom_border: ColorValue,
#[serde(default = "default_on_accent_text")]
pub on_accent_text: ColorValue,
#[serde(default = "default_knob_fill")]
pub knob_fill: ColorValue,
#[serde(default = "default_drop_shadow")]
pub drop_shadow: ColorValue,
#[serde(default = "default_backdrop_dim")]
pub backdrop_dim: ColorValue,
#[serde(default = "default_hud_background")]
pub hud_background: ColorValue,
#[serde(default = "default_hud_border")]
pub hud_border: ColorValue,
#[serde(default = "default_hud_text")]
pub hud_text: ColorValue,
#[serde(default = "default_hud_secondary_text")]
pub hud_secondary_text: ColorValue,
#[serde(default = "default_caption_close_hover")]
pub caption_close_hover: ColorValue,
#[serde(default = "default_caption_close_pressed")]
pub caption_close_pressed: ColorValue,
#[serde(default = "default_caption_hover")]
pub caption_hover: ColorValue,
#[serde(default = "default_caption_pressed")]
pub caption_pressed: ColorValue,
#[serde(default = "default_traffic_light_glyph")]
pub traffic_light_glyph: ColorValue,
#[serde(default = "default_scrollbar_thumb")]
pub scrollbar_thumb: ColorValue,
#[serde(default = "default_scrollbar_thumb_active")]
pub scrollbar_thumb_active: ColorValue,
}
fn default_label_color() -> ColorValue {
ColorValue {
value: "rgba(0, 0, 0, 0.85)".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_secondary_label_color() -> ColorValue {
ColorValue {
value: "rgba(0, 0, 0, 0.50)".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_system_green() -> ColorValue {
ColorValue {
value: "#34C759".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_system_yellow() -> ColorValue {
ColorValue {
value: "#FFCC00".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_system_orange() -> ColorValue {
ColorValue {
value: "#FF9500".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_system_red() -> ColorValue {
ColorValue {
value: "#FF3B30".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_alternating_row_even() -> ColorValue {
ColorValue {
value: "#FFFFFF".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_alternating_row_odd() -> ColorValue {
ColorValue {
value: "#F4F5F5".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_scrubber_selection_border() -> ColorValue {
ColorValue {
value: "#FFCC00".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_scrubber_outside_dim() -> ColorValue {
ColorValue {
value: "rgba(0, 0, 0, 0.58)".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_scrubber_waveform() -> ColorValue {
ColorValue {
value: "#007AFF".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_scrubber_playhead() -> ColorValue {
ColorValue {
value: "#FFFFFF".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_close() -> ColorValue {
ColorValue {
value: "#FF5F56".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_close_border() -> ColorValue {
ColorValue {
value: "#E0443E".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_minimize() -> ColorValue {
ColorValue {
value: "#FFBD2E".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_minimize_border() -> ColorValue {
ColorValue {
value: "#D69A1E".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_zoom() -> ColorValue {
ColorValue {
value: "#27C93F".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_traffic_light_zoom_border() -> ColorValue {
ColorValue {
value: "#1BA931".to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn color_val(val: &str) -> ColorValue {
ColorValue {
value: val.to_string(),
token_type: Some("color".to_string()),
description: None,
}
}
fn default_on_accent_text() -> ColorValue {
color_val("#FFFFFF")
}
fn default_knob_fill() -> ColorValue {
color_val("#FFFFFF")
}
fn default_drop_shadow() -> ColorValue {
color_val("rgba(0, 0, 0, 0.12)")
}
fn default_backdrop_dim() -> ColorValue {
color_val("rgba(0, 0, 0, 0.40)")
}
fn default_hud_background() -> ColorValue {
color_val("rgba(30, 30, 32, 0.90)")
}
fn default_hud_border() -> ColorValue {
color_val("#3C3C3E")
}
fn default_hud_text() -> ColorValue {
color_val("#F2F2F7")
}
fn default_hud_secondary_text() -> ColorValue {
color_val("#B4B4B8")
}
fn default_caption_close_hover() -> ColorValue {
color_val("#E81123")
}
fn default_caption_close_pressed() -> ColorValue {
color_val("#C42B1C")
}
fn default_caption_hover() -> ColorValue {
color_val("rgba(0, 0, 0, 0.06)")
}
fn default_caption_pressed() -> ColorValue {
color_val("rgba(0, 0, 0, 0.11)")
}
fn default_traffic_light_glyph() -> ColorValue {
color_val("rgba(0, 0, 0, 0.63)")
}
fn default_scrollbar_thumb() -> ColorValue {
color_val("rgba(0, 0, 0, 0.45)")
}
fn default_scrollbar_thumb_active() -> ColorValue {
color_val("rgba(0, 0, 0, 0.70)")
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MacColorTokens {
pub aqua: MacAppearanceColors,
pub dark_aqua: MacAppearanceColors,
}