Document focus contrast and set row highlight opacity explicitly (#82)
This commit was merged in pull request #92.
This commit is contained in:
1 parent
eb21db17ad
commit
3de8fd527c
3 files changed
+23
-14
No files matched your search
+17
-9
@@ -9,17 +9,23 @@ use gpui_kit::*;
|
||||
const INTER: &str = "Inter Variable Text";
|
||||
const UNBOUNDED: &str = "Unbounded";
|
||||
|
||||
/// Gold on the logo and on dark portrait overlays in either theme.
|
||||
pub const LOGO_GOLD: u32 = 0xf5b83d;
|
||||
const LIGHT_GOLD: u32 = 0xe3a21a;
|
||||
/// Dark ink for text and icons on a solid gold fill.
|
||||
pub const ON_GOLD: u32 = 0x161b2e;
|
||||
|
||||
/// Background of a card or statistics tile.
|
||||
pub fn surface(theme: &Theme) -> Hsla {
|
||||
theme.muted
|
||||
}
|
||||
|
||||
/// Background of the home and champ select headers.
|
||||
pub fn banner_band(theme: &Theme) -> Hsla {
|
||||
theme.title_bar
|
||||
}
|
||||
|
||||
/// Gold for text on a neutral surface, darker in the light theme.
|
||||
pub fn gold_ink(theme: &Theme) -> Hsla {
|
||||
theme.link
|
||||
}
|
||||
@@ -94,20 +100,22 @@ fn init_with_heading_font(cx: &mut App, heading_bytes: &'static [u8]) {
|
||||
role!(0xedeaf7, ON_GOLD => foreground, popover_foreground, accent_foreground, secondary_foreground);
|
||||
role!(0x8b91b1, 0x596082 => muted_foreground, tab_foreground, table_head_foreground, scrollbar_thumb_hover);
|
||||
role!(0x3a4166, 0xc5cbe0 => switch, scrollbar_thumb);
|
||||
role!(LOGO_GOLD, 0xe3a21a => primary, tab_active, chart_1, chart_2, chart_3, chart_4, chart_5, slider_bar, progress_bar);
|
||||
role!(LOGO_GOLD, LIGHT_GOLD => primary, tab_active, chart_1, chart_2, chart_3, chart_4, chart_5, slider_bar, progress_bar);
|
||||
role!(LOGO_GOLD, 0x8f5d00 => link, link_hover, link_active, caret, warning, ring, drag_border, list_active_border, table_active_border);
|
||||
role!(0xff7a7a, 0xc62f2f => danger);
|
||||
role!(0x67e8f9, 0x11667b => info);
|
||||
role!(0x4ade80, 0x196638 => success);
|
||||
role!(ON_GOLD, ON_GOLD => primary_foreground, tab_active_foreground);
|
||||
let selection = config
|
||||
.colors
|
||||
.primary
|
||||
.as_ref()
|
||||
.map(|gold| SharedString::from(format!("{gold}38")));
|
||||
config.colors.selection = selection.clone();
|
||||
config.colors.list_active = selection.clone();
|
||||
config.colors.table_active = selection;
|
||||
let gold = if config.mode.is_dark() {
|
||||
LOGO_GOLD
|
||||
} else {
|
||||
LIGHT_GOLD
|
||||
};
|
||||
let tint = |alpha: u8| Some(SharedString::from(format!("#{gold:06x}{alpha:02x}")));
|
||||
config.colors.selection = tint(0x38);
|
||||
// The kit caps row highlights at 20% opacity.
|
||||
config.colors.list_active = tint(0x33);
|
||||
config.colors.table_active = config.colors.list_active.clone();
|
||||
// Let the kit derive pressed and hovered primary buttons from our gold.
|
||||
config.colors.primary_active = None;
|
||||
config.colors.primary_hover = None;
|
||||
|
||||
Reference in new issue
Block a user