by roundabout, Saturday, 9 February 2019, 02:21:32 (1549678892), pushed by roundabout, Sunday, 11 May 2025, 13:22:33 (1746969753)
Author identity: nana-4 <hnmaigo@gmail.com>
fedc9a73cb728b34ee358ea9083685cf6e7f929b
src/_sass/_colors.scss.template
@@ -7,91 +7,119 @@
@return unquote("alpha(#{$c}, #{$a})");
}
// Foreground colors
$dark_fg_color: %FG%;
$light_fg_color: %BG%;
$fg_color: %FG%;
$secondary_fg_color: rgba(%FG%, 0.7);
$disabled_fg_color: rgba(%FG%, 0.5);
$disabled_secondary_fg_color: rgba(%FG%, 0.3);
$track_color: rgba(%FG%, 0.3);
$divider_color: rgba(%FG%, 0.12);
$fill_color: rgba(%FG%, 0.04);
$titlebar_fg_color: %HDR_FG%;
$titlebar_secondary_fg_color: rgba(%HDR_FG%, 0.7);
$titlebar_disabled_fg_color: rgba(%HDR_FG%, 0.5);
$titlebar_disabled_secondary_fg_color: rgba(%HDR_FG%, 0.3);
$titlebar_track_color: rgba(%HDR_FG%, 0.3);
$titlebar_divider_color: rgba(%HDR_FG%, 0.12);
$titlebar_fill_color: rgba(%HDR_FG%, 0.04);
$inverse_fg_color: white;
$inverse_secondary_fg_color: rgba(white, 0.7);
$inverse_disabled_fg_color: rgba(white, 0.5);
$inverse_disabled_secondary_fg_color: rgba(white, 0.3);
$inverse_track_color: rgba(white, 0.3);
$inverse_divider_color: rgba(white, 0.12);
$inverse_fill_color: rgba(white, 0.04);
// Background colors
$bg_color: %BG%;
$base_color: %MATERIA_VIEW%;
$alt_base_color: %INACTIVE_MATERIA_VIEW%;
$surface_color: %MATERIA_SURFACE%;
$titlebar_bg_color: %HDR_BG%;
$panel_bg_color: rgba(black, %MATERIA_PANEL_OPACITY%);
$alt_panel_bg_color: rgba(black, 0.3);
$inverse_panel_bg_color: rgba(white, 0.1);
$solid_panel_bg_color: if($titlebar == 'dark', %HDR_BG3%, $panel_bg_color);
$opaque_panel_bg_color: %HDR_BG3%; // for Unity panel which cannot use translucent colors
$gdm_bg_color: %HDR_BG3%;
$hover_overlay_color: gtkalpha(currentColor, 0.08);
$focus_overlay_color: gtkalpha(currentColor, 0.12);
$hover_focus_overlay_color: gtkalpha(currentColor, 0.16);
$active_overlay_color: gtkalpha(currentColor, 0.12);
$checked_overlay_color: gtkalpha(currentColor, 0.24);
@function on($color, $state: 'primary') {
// Calculate color brightness according to https://www.w3.org/TR/AERT/#color-contrast
$brightness: (red($color) * 299 + green($color) * 587 + blue($color) * 114) / 1000;
@if ($brightness >= 128) {
@if ($state == 'primary') { @return rgba(black, 0.87); }
@if ($state == 'secondary') { @return rgba(black, 0.54); }
@if ($state == 'disabled') { @return rgba(black, 0.38); }
@if ($state == 'secondary-disabled') { @return rgba(black, 0.26); }
@if ($state == 'track') { @return rgba(black, 0.26); }
@if ($state == 'divider') { @return rgba(black, 0.12); }
@if ($state == 'fill') { @return rgba(black, 0.04); }
} @else {
@if ($state == 'primary') { @return white; }
@if ($state == 'secondary') { @return rgba(white, 0.7); }
@if ($state == 'disabled') { @return rgba(white, 0.5); }
@if ($state == 'secondary-disabled') { @return rgba(white, 0.3); }
@if ($state == 'track') { @return rgba(white, 0.3); }
@if ($state == 'divider') { @return rgba(white, 0.12); }
@if ($state == 'fill') { @return rgba(white, 0.04); }
}
}
@function highlight($color) {
@if (lightness($color) > 80%) { @return rgba(white, 0.4); }
@else if (lightness($color) > 40%) { @return rgba(white, 0.2); }
@else { @return rgba(white, 0.1); }
}
//
// Basic colors
//
$blue: %TERMINAL_COLOR12%;
$green: %TERMINAL_COLOR10%;
$yellow: %TERMINAL_COLOR11%;
$red: %TERMINAL_COLOR9%;
$primary: %SEL_BG%;
$primary-alt: %SEL_BG2%;
$background: %BG%;
$surface: %MATERIA_SURFACE%;
$base: %MATERIA_VIEW%;
$base-alt: %INACTIVE_MATERIA_VIEW%;
$os-background: %HDR_BG3%;
$tooltip: rgba(%HDR_BG%, 0.9);
$scrim: rgba(black, %MATERIA_PANEL_OPACITY%);
$scrim-alt: rgba(black, 0.3);
$scrim-inverse: rgba(white, 0.1);
$titlebar: %HDR_BG%;
$panel: if($titlebar == 'dark', %HDR_BG3%, $scrim);
$panel-solid: %HDR_BG3%; // for Unity panel which doesn't allow translucent colors
//
// Misc colors
$primary_color: %SEL_BG%;
$alt_primary_color: %SEL_BG2%;
$selected_overlay_color: rgba($primary_color, %MATERIA_SELECTION_OPACITY%);
$link_color: %TERMINAL_COLOR4%;
$visited_link_color: %TERMINAL_COLOR5%;
$warning_color: %TERMINAL_COLOR11%;
$error_color: %TERMINAL_COLOR9%;
$success_color: %TERMINAL_COLOR10%;
$suggested_color: $primary_color;
$destructive_color: $error_color;
$info_bg_color: %TERMINAL_COLOR12%;
$question_bg_color: $info_bg_color;
$warning_bg_color: $warning_color;
$error_bg_color: $error_color;
$tooltip_bg_color: rgba(%HDR_BG%, 0.9);
$tooltip_fg_color: %HDR_FG%;
$border_color: if($variant == 'light', rgba(black, 0.12), rgba(black, 0.26));
$alt_border_color: rgba(black, 0.26); // for non-native GTK+ apps (e.g. Firefox and Chrome)
$highlight_color: if($variant == 'light', rgba(white, 0.4), rgba(white, 0.1));
$titlebar_highlight_color: if($titlebar == 'dark', rgba(white, 0.1), rgba(white, 0.4));
$alt_highlight_color: rgba(white, 0.2); // for selection-mode headerbar which colored with $primary_color
$titlebar_indicator_color: if($titlebar == 'dark', currentColor, $primary_color);
// FIXME: Electron/Atom menu does not allow translucent colors
$opaque_fg_color: %FG%;
$opaque_secondary_fg_color: mix(%FG%, $surface_color, percentage(0.7));
$opaque_disabled_fg_color: mix(%FG%, $surface_color, percentage(0.5));
$opaque_divider_color: mix(%FG%, $surface_color, percentage(0.12));
// FIXME: gtk @placeholder_text_color does not allow translucent colors
$placeholder_text_color: mix(%FG%, $base_color, percentage(0.7));
//
$link: $primary;
$link-visited: %TERMINAL_COLOR5%;
$warning: %TERMINAL_COLOR11%;
$error: %TERMINAL_COLOR9%;
$success: %TERMINAL_COLOR10%;
$suggested: $primary;
$destructive: $error;
$infobar-info: %TERMINAL_COLOR10%;
$infobar-question: %TERMINAL_COLOR12%;
$infobar-warning: $warning;
$infobar-error: $error;
$border: if($variant == 'light', rgba(black, 0.12), rgba(black, 0.26));
$border-alt: rgba(black, 0.26); // darker border color for Chrome and Firefox
$titlebar-indicator: if($topbar == 'dark', currentColor, $primary);
//
// Overlay state colors
//
$overlay-hover: gtkalpha(currentColor, 0.08);
$overlay-focus: gtkalpha(currentColor, 0.12);
$overlay-focus-hover: gtkalpha(currentColor, 0.16);
$overlay-active: gtkalpha(currentColor, 0.12);
$overlay-checked: gtkalpha(currentColor, 0.24);
$overlay-selected: rgba($primary, %MATERIA_SELECTION_OPACITY%);
//
// Text and derivative colors
//
$text: %FG%;
$text-secondary: rgba(%FG%, 0.7);
$text-disabled: rgba(%FG%, 0.5);
$text-secondary-disabled: rgba(%FG%, 0.3);
$track: rgba(%FG%, 0.3);
$divider: rgba(%FG%, 0.12);
$fill: rgba(%FG%, 0.04);
$titlebar-text: %HDR_FG%;
$titlebar-text-secondary: rgba(%HDR_FG%, 0.7);
$titlebar-text-disabled: rgba(%HDR_FG%, 0.5);
$titlebar-text-secondary-disabled: rgba(%HDR_FG%, 0.3);
$titlebar-track: rgba(%HDR_FG%, 0.3);
$titlebar-divider: rgba(%HDR_FG%, 0.12);
$titlebar-fill: rgba(%HDR_FG%, 0.04);
// workaround for Electron menu which doesn't allow translucent colors
$solid-text: %FG%;
$solid-text-secondary: mix(%FG%, $surface, percentage(0.7));
$solid-text-disabled: mix(%FG%, $surface, percentage(0.5));
$solid-divider: mix(%FG%, $surface, percentage(0.12));
// workaround for GTK3 @placeholder_text_color which doesn't allow translucent colors
$placeholder_text_color: mix(%FG%, $base, percentage(0.7));