A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 _colors.scss.template

View raw Download
text/plain • 5.38 kiB
ASCII text
        
            
1
// When color definition differs for dark and light variant,
2
// it gets @if ed depending on $variant
3
4
@import 'color-palette';
5
6
@function gtkalpha($c, $a) {
7
@return unquote("alpha(#{$c}, #{$a})");
8
}
9
10
@function on($color, $state: 'primary') {
11
@if ($color == 'light') { $color: white; }
12
@if ($color == 'dark') { $color: black; }
13
14
// Calculate color brightness according to https://www.w3.org/TR/AERT/#color-contrast
15
$brightness: (red($color) * 299 + green($color) * 587 + blue($color) * 114) / 1000;
16
17
@if ($brightness >= 128) {
18
@if ($state == 'primary') { @return rgba(black, 0.87); }
19
@if ($state == 'secondary') { @return rgba(black, 0.54); }
20
@if ($state == 'disabled') { @return rgba(black, 0.38); }
21
@if ($state == 'secondary-disabled') { @return rgba(black, 0.26); }
22
@if ($state == 'track') { @return rgba(black, 0.26); }
23
@if ($state == 'divider') { @return rgba(black, 0.12); }
24
@if ($state == 'fill') { @return rgba(black, 0.04); }
25
} @else {
26
@if ($state == 'primary') { @return white; }
27
@if ($state == 'secondary') { @return rgba(white, 0.7); }
28
@if ($state == 'disabled') { @return rgba(white, 0.5); }
29
@if ($state == 'secondary-disabled') { @return rgba(white, 0.3); }
30
@if ($state == 'track') { @return rgba(white, 0.3); }
31
@if ($state == 'divider') { @return rgba(white, 0.12); }
32
@if ($state == 'fill') { @return rgba(white, 0.04); }
33
}
34
}
35
36
@function highlight($color) {
37
@if (lightness($color) > 80%) { @return rgba(white, 0.4); }
38
@else if (lightness($color) > 40%) { @return rgba(white, 0.2); }
39
@else { @return rgba(white, 0.1); }
40
}
41
42
//
43
// Basic colors
44
//
45
46
$blue: %TERMINAL_COLOR12%;
47
$green: %TERMINAL_COLOR10%;
48
$yellow: %TERMINAL_COLOR11%;
49
$red: %TERMINAL_COLOR9%;
50
51
$primary: %SEL_BG%;
52
$primary-alt: %SEL_BG2%;
53
54
$background: %BG%;
55
$surface: %MATERIA_SURFACE%;
56
$base: %MATERIA_VIEW%;
57
$base-alt: %INACTIVE_MATERIA_VIEW%;
58
59
$os-background: %HDR_BG3%;
60
$tooltip: rgba(%HDR_BG%, 0.9);
61
$scrim: rgba(black, %MATERIA_PANEL_OPACITY%);
62
$scrim-alt: rgba(black, 0.3);
63
$scrim-inverse: rgba(white, 0.1);
64
$titlebar: %HDR_BG%;
65
$panel: if($topbar == 'dark', %HDR_BG3%, $scrim);
66
$panel-solid: %HDR_BG3%; // for Unity panel which doesn't allow translucent colors
67
68
//
69
// Misc colors
70
//
71
72
$link: $primary;
73
$link-visited: %TERMINAL_COLOR5%;
74
75
$warning: %TERMINAL_COLOR11%;
76
$error: %TERMINAL_COLOR9%;
77
$success: %TERMINAL_COLOR10%;
78
79
$suggested: $primary;
80
$destructive: $error;
81
82
$infobar-info: %TERMINAL_COLOR10%;
83
$infobar-question: %TERMINAL_COLOR12%;
84
$infobar-warning: $warning;
85
$infobar-error: $error;
86
87
$border: if($variant == 'light', rgba(black, 0.12), rgba(black, 0.26));
88
$border-alt: rgba(black, 0.26); // darker border color for Chrome and Firefox
89
$titlebar-indicator: if($topbar == 'dark', currentColor, $primary);
90
91
//
92
// Overlay state colors
93
//
94
95
$overlay-hover: gtkalpha(currentColor, 0.08);
96
$overlay-focus: gtkalpha(currentColor, 0.12);
97
$overlay-focus-hover: gtkalpha(currentColor, 0.16);
98
$overlay-active: gtkalpha(currentColor, 0.12);
99
$overlay-checked: gtkalpha(currentColor, 0.24);
100
$overlay-selected: rgba($primary, %MATERIA_SELECTION_OPACITY%);
101
102
//
103
// Text and derivative colors
104
//
105
106
$text: %FG%;
107
$text-secondary: rgba(%FG%, 0.7);
108
$text-disabled: rgba(%FG%, 0.5);
109
$text-secondary-disabled: rgba(%FG%, 0.3);
110
$track: rgba(%FG%, 0.3);
111
$divider: rgba(%FG%, 0.12);
112
$fill: rgba(%FG%, 0.04);
113
114
$titlebar-text: %HDR_FG%;
115
$titlebar-text-secondary: rgba(%HDR_FG%, 0.7);
116
$titlebar-text-disabled: rgba(%HDR_FG%, 0.5);
117
$titlebar-text-secondary-disabled: rgba(%HDR_FG%, 0.3);
118
$titlebar-track: rgba(%HDR_FG%, 0.3);
119
$titlebar-divider: rgba(%HDR_FG%, 0.12);
120
$titlebar-fill: rgba(%HDR_FG%, 0.04);
121
122
// workaround for Electron menu which doesn't allow translucent colors
123
$solid-text: %FG%;
124
$solid-text-secondary: mix(%FG%, $surface, percentage(0.7));
125
$solid-text-disabled: mix(%FG%, $surface, percentage(0.5));
126
$solid-divider: mix(%FG%, $surface, percentage(0.12));
127
128
// workaround for GTK3 @placeholder_text_color which doesn't allow translucent colors
129
$placeholder_text_color: mix(%FG%, $base, percentage(0.7));
130