Skip to main content

netrunner_gui/
theme.rs

1//! Cyberpunk colour palette for the GPUI desktop app, mirroring the TUI theme.
2
3use gpui::{rgb, Rgba};
4
5pub const BG: u32 = 0x0a0a14;
6pub const PANEL_BG: u32 = 0x12121f;
7pub const PANEL_BORDER: u32 = 0x2a2a45;
8
9pub const CYAN: u32 = 0x00ffff;
10pub const MAGENTA: u32 = 0xff00ff;
11pub const GREEN: u32 = 0x00ff80;
12pub const YELLOW: u32 = 0xffdc00;
13pub const BLUE: u32 = 0x3c8cff;
14pub const RED: u32 = 0xff3c3c;
15
16pub const TEXT: u32 = 0xe6e6f0;
17pub const MUTED: u32 = 0x8080a0;
18
19/// Colour for a download bar based on its share of the peak (hot = fast).
20pub fn download_color() -> Rgba {
21    rgb(GREEN)
22}
23
24/// Colour for an upload bar.
25pub fn upload_color() -> Rgba {
26    rgb(CYAN)
27}
28
29/// Build an `Rgba` from 8-bit RGB components (used by the shared macro).
30pub fn rgb8(r: u8, g: u8, b: u8) -> Rgba {
31    rgb(((r as u32) << 16) | ((g as u32) << 8) | b as u32)
32}
33
34// Generate `quality_color` from the canonical palette in `netrunner_core`, so
35// the GUI and TUI use identical colours for each connection quality.
36netrunner_core::quality_color_fn!(
37    /// GPUI colour for a connection quality.
38    pub fn quality_color -> Rgba { rgb8 }
39);