interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / design / tokens / allen_tokens.rs

339 lines · 13339 bytes Raw Blame History
1// allen_tokens.rs -- Allen's look as constants.
2// Generated from docs/design/DESIGN.md by allen-design-tokens. Do not edit; change DESIGN.md and run
3// `cargo run -p allen-design-tokens -- generate`.
4// Core types only, so no_std code can include!() this file.
5
6/// An sRGB colour.
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub struct Rgb {
9 pub r: u8,
10 pub g: u8,
11 pub b: u8,
12}
13
14impl Rgb {
15 /// Packed as the kernel's CK_RGB.
16 pub const fn packed(self) -> u32 {
17 (self.r as u32) << 16 | (self.g as u32) << 8 | self.b as u32
18 }
19}
20
21/// A CSS cubic-bezier easing curve, control points in Q16 (65536 = 1.0).
22#[derive(Debug, Clone, Copy, PartialEq, Eq)]
23pub struct Bezier {
24 pub x1: i32,
25 pub y1: i32,
26 pub x2: i32,
27 pub y2: i32,
28}
29
30pub mod version {
31 #[allow(unused_imports)]
32 use super::{Bezier, Rgb};
33}
34
35pub mod name {
36 #[allow(unused_imports)]
37 use super::{Bezier, Rgb};
38}
39
40pub mod description {
41 #[allow(unused_imports)]
42 use super::{Bezier, Rgb};
43}
44
45pub mod colors {
46 #[allow(unused_imports)]
47 use super::{Bezier, Rgb};
48 pub const PRIMARY: Rgb = Rgb { r: 236, g: 240, b: 252 };
49 pub const NIGHT: Rgb = Rgb { r: 6, g: 8, b: 18 };
50 pub const HINT: Rgb = Rgb { r: 150, g: 160, b: 196 };
51 pub const FAINT: Rgb = Rgb { r: 130, g: 140, b: 176 };
52 pub const GLOW: Rgb = Rgb { r: 150, g: 170, b: 255 };
53 pub const MIST: Rgb = Rgb { r: 200, g: 210, b: 255 };
54 pub const INK: Rgb = Rgb { r: 64, g: 86, b: 196 };
55 pub const WARM: Rgb = Rgb { r: 255, g: 212, b: 150 };
56 pub const WARM_SOFT: Rgb = Rgb { r: 255, g: 222, b: 180 };
57 pub const HEART: Rgb = Rgb { r: 255, g: 210, b: 170 };
58 pub const HEART_CORE: Rgb = Rgb { r: 255, g: 236, b: 214 };
59 pub const HALO: Rgb = Rgb { r: 60, g: 74, b: 210 };
60 pub const HALO_VIOLET: Rgb = Rgb { r: 112, g: 92, b: 255 };
61 pub const SKY_GLOW: Rgb = Rgb { r: 110, g: 130, b: 255 };
62 pub const PANEL: Rgb = Rgb { r: 12, g: 16, b: 38 };
63 pub const LIT: Rgb = Rgb { r: 59, g: 68, b: 111 };
64}
65
66pub mod typography {
67 #[allow(unused_imports)]
68 use super::{Bezier, Rgb};
69 pub const VOICE_FONTFAMILY: &str = "Quicksand";
70 pub const VOICE_FONTSIZE_PX: u32 = 27;
71 pub const VOICE_FONTWEIGHT: u32 = 400;
72 pub const VOICE_LINEHEIGHT_PX: u32 = 40;
73 pub const VOICE_LETTERSPACING_EM: f32 = 0.02;
74 pub const BODY_FONTFAMILY: &str = "Quicksand";
75 pub const BODY_FONTSIZE_PX: u32 = 21;
76 pub const BODY_FONTWEIGHT: u32 = 500;
77 pub const BODY_LINEHEIGHT_PX: u32 = 30;
78 pub const BODY_LETTERSPACING_EM: f32 = 0.01;
79 pub const SMALL_FONTFAMILY: &str = "Quicksand";
80 pub const SMALL_FONTSIZE_PX: u32 = 16;
81 pub const SMALL_FONTWEIGHT: u32 = 500;
82 pub const SMALL_LINEHEIGHT_PX: u32 = 22;
83 pub const SMALL_LETTERSPACING_EM: f32 = 0.02;
84 pub const TITLE_FONTFAMILY: &str = "Quicksand";
85 pub const TITLE_FONTSIZE_PX: u32 = 40;
86 pub const TITLE_FONTWEIGHT: u32 = 300;
87 pub const TITLE_LINEHEIGHT_PX: u32 = 52;
88 pub const TITLE_LETTERSPACING_EM: f32 = 0.04;
89}
90
91pub mod rounded {
92 #[allow(unused_imports)]
93 use super::{Bezier, Rgb};
94 pub const SM_PX: u32 = 8;
95 pub const MD_PX: u32 = 14;
96 pub const PANEL_PX: u32 = 22;
97 pub const PILL_PX: u32 = 999;
98}
99
100pub mod spacing {
101 #[allow(unused_imports)]
102 use super::{Bezier, Rgb};
103 pub const XS_PX: u32 = 4;
104 pub const SM_PX: u32 = 8;
105 pub const MD_PX: u32 = 16;
106 pub const LG_PX: u32 = 24;
107 pub const XL_PX: u32 = 40;
108 pub const XXL_PX: u32 = 72;
109 pub const BAR_WIDTH_PX: u32 = 720;
110 pub const BAR_HEIGHT_PX: u32 = 54;
111 pub const BAR_BOTTOM_PX: u32 = 96;
112 pub const TEXT_WIDTH_PX: u32 = 900;
113 pub const WORDS_BELOW_CENTRE_PX: u32 = 250;
114}
115
116pub mod components {
117 #[allow(unused_imports)]
118 use super::{Bezier, Rgb};
119 pub const PAGE_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
120 pub const PAGE_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
121 // PAGE_TYPOGRAPHY: typography.body
122 pub const ALLEN_SAYS_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
123 pub const ALLEN_SAYS_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
124 // ALLEN_SAYS_TYPOGRAPHY: typography.voice
125 pub const ALLEN_TITLE_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
126 pub const ALLEN_TITLE_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
127 // ALLEN_TITLE_TYPOGRAPHY: typography.title
128 pub const HINT_TEXT_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
129 pub const HINT_TEXT_TEXTCOLOR: Rgb = Rgb { r: 150, g: 160, b: 196 };
130 // HINT_TEXT_TYPOGRAPHY: typography.small
131 pub const FINE_PRINT_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
132 pub const FINE_PRINT_TEXTCOLOR: Rgb = Rgb { r: 130, g: 140, b: 176 };
133 // FINE_PRINT_TYPOGRAPHY: typography.small
134 pub const INPUT_BAR_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
135 pub const INPUT_BAR_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
136 // INPUT_BAR_TYPOGRAPHY: typography.body
137 pub const INPUT_BAR_ROUNDED_PX: u32 = 999;
138 pub const INPUT_BAR_HEIGHT_PX: u32 = 54;
139 pub const INPUT_BAR_WIDTH_PX: u32 = 720;
140 pub const INPUT_BAR_CARET_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
141 pub const INPUT_BAR_CARET_TEXTCOLOR: Rgb = Rgb { r: 150, g: 170, b: 255 };
142 pub const CHOICE_BACKGROUNDCOLOR: Rgb = Rgb { r: 12, g: 16, b: 38 };
143 pub const CHOICE_TEXTCOLOR: Rgb = Rgb { r: 200, g: 210, b: 255 };
144 // CHOICE_TYPOGRAPHY: typography.body
145 pub const CHOICE_ROUNDED_PX: u32 = 14;
146 pub const CHOICE_PADDING_PX: u32 = 16;
147 pub const CHOICE_LIT_BACKGROUNDCOLOR: Rgb = Rgb { r: 59, g: 68, b: 111 };
148 pub const CHOICE_LIT_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
149 // CHOICE_LIT_TYPOGRAPHY: typography.body
150 pub const CHOICE_LIT_ROUNDED_PX: u32 = 14;
151 pub const CHOICE_LIT_PADDING_PX: u32 = 16;
152 pub const BUTTON_PRIMARY_BACKGROUNDCOLOR: Rgb = Rgb { r: 59, g: 68, b: 111 };
153 pub const BUTTON_PRIMARY_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
154 // BUTTON_PRIMARY_TYPOGRAPHY: typography.body
155 pub const BUTTON_PRIMARY_ROUNDED_PX: u32 = 999;
156 pub const BUTTON_PRIMARY_PADDING_PX: u32 = 14;
157 pub const BUTTON_PRIMARY_HOVER_BACKGROUNDCOLOR: Rgb = Rgb { r: 59, g: 68, b: 111 };
158 pub const BUTTON_PRIMARY_HOVER_TEXTCOLOR: Rgb = Rgb { r: 255, g: 222, b: 180 };
159 pub const BUTTON_SECONDARY_BACKGROUNDCOLOR: Rgb = Rgb { r: 12, g: 16, b: 38 };
160 pub const BUTTON_SECONDARY_TEXTCOLOR: Rgb = Rgb { r: 200, g: 210, b: 255 };
161 pub const BUTTON_SECONDARY_ROUNDED_PX: u32 = 999;
162 pub const BUTTON_SECONDARY_PADDING_PX: u32 = 14;
163 pub const PANEL_BACKGROUNDCOLOR: Rgb = Rgb { r: 12, g: 16, b: 38 };
164 pub const PANEL_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
165 pub const PANEL_ROUNDED_PX: u32 = 22;
166 pub const PANEL_PADDING_PX: u32 = 24;
167 pub const FOUND_LINE_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
168 pub const FOUND_LINE_TEXTCOLOR: Rgb = Rgb { r: 236, g: 240, b: 252 };
169 // FOUND_LINE_TYPOGRAPHY: typography.body
170 pub const FOUND_LINE_LABEL_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
171 pub const FOUND_LINE_LABEL_TEXTCOLOR: Rgb = Rgb { r: 150, g: 160, b: 196 };
172 // FOUND_LINE_LABEL_TYPOGRAPHY: typography.body
173 pub const STATE_WORD_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
174 pub const STATE_WORD_TEXTCOLOR: Rgb = Rgb { r: 150, g: 170, b: 255 };
175 // STATE_WORD_TYPOGRAPHY: typography.small
176 pub const STATE_WORD_NEEDS_YOU_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
177 pub const STATE_WORD_NEEDS_YOU_TEXTCOLOR: Rgb = Rgb { r: 255, g: 212, b: 150 };
178 // STATE_WORD_NEEDS_YOU_TYPOGRAPHY: typography.small
179 pub const FOCUS_RING_BACKGROUNDCOLOR: Rgb = Rgb { r: 6, g: 8, b: 18 };
180 pub const FOCUS_RING_TEXTCOLOR: Rgb = Rgb { r: 200, g: 210, b: 255 };
181 pub const ORB_HALO_BACKGROUNDCOLOR: Rgb = Rgb { r: 60, g: 74, b: 210 };
182 pub const ORB_HALO_VIOLET_BACKGROUNDCOLOR: Rgb = Rgb { r: 112, g: 92, b: 255 };
183 pub const ORB_HEART_BACKGROUNDCOLOR: Rgb = Rgb { r: 255, g: 210, b: 170 };
184 pub const ORB_HEART_CORE_BACKGROUNDCOLOR: Rgb = Rgb { r: 255, g: 236, b: 214 };
185 pub const WATER_BACKGROUNDCOLOR: Rgb = Rgb { r: 64, g: 86, b: 196 };
186 pub const SKY_WASH_BACKGROUNDCOLOR: Rgb = Rgb { r: 110, g: 130, b: 255 };
187}
188
189pub mod native_type {
190 #[allow(unused_imports)]
191 use super::{Bezier, Rgb};
192 pub const VOICE_CAP_PX: u32 = 19;
193 pub const BODY_CAP_PX: u32 = 15;
194 pub const SMALL_CAP_PX: u32 = 11;
195 pub const VOICE_WEIGHT: u32 = 1000;
196 pub const BODY_WEIGHT: u32 = 1150;
197 pub const SMALL_WEIGHT: u32 = 1250;
198 pub const LINE_PX: u32 = 40;
199 pub const WRAP_PX: u32 = 900;
200}
201
202pub mod motion {
203 #[allow(unused_imports)]
204 use super::{Bezier, Rgb};
205 pub const EASE_SMOOTH: Bezier = Bezier { x1: 21843, y1: 0, x2: 43693, y2: 65536 };
206 pub const EASE_OUT: Bezier = Bezier { x1: 21843, y1: 65536, x2: 43693, y2: 65536 };
207 pub const EASE_ENTER: Bezier = Bezier { x1: 14418, y1: 39977, x2: 23593, y2: 65536 };
208 pub const FRAME_MS: u32 = 16;
209 pub const LETTER_MS: u32 = 35;
210 pub const LETTER_COOL_MS: u32 = 900;
211 pub const WORD_RISE_MS: u32 = 600;
212 pub const WORDS_FADE_MS: u32 = 450;
213 pub const READ_BASE_MS: u32 = 6000;
214 pub const READ_PER_LETTER_MS: u32 = 70;
215 pub const STATE_BLEND_MS: u32 = 700;
216 pub const CHOICE_LIT_MS: u32 = 100;
217 pub const DAWN_MS: u32 = 900;
218 pub const DUSK_MS: u32 = 4000;
219 pub const DUSK_FALLBACK_MS: u32 = 1400;
220 pub const BAR_REST_MS: u32 = 9000;
221 pub const BAR_RISE_MS: u32 = 900;
222 pub const CARET_BREATH_MS: u32 = 1100;
223 pub const CARET_HOLD_MS: u32 = 500;
224 pub const MIND_FORM_MS: u32 = 3000;
225 pub const ENTER_RISE_PX: u32 = 10;
226 pub const ENTER_BLUR_PX: u32 = 3;
227}
228
229pub mod heartbeat {
230 #[allow(unused_imports)]
231 use super::{Bezier, Rgb};
232 pub const BREATH_PERIOD_MS: u32 = 5500;
233 pub const BREATH_DEPTH: f32 = 0.03;
234 pub const BREATH_DEPTH_Q16: i32 = 1966;
235 pub const THINK_PULSE_PERIOD_MS: u32 = 900;
236 pub const HEART_IDLE: f32 = 0.195;
237 pub const HEART_IDLE_Q16: i32 = 12780;
238 pub const HEART_LISTEN: f32 = 0.273;
239 pub const HEART_LISTEN_Q16: i32 = 17891;
240 pub const HEART_THINK: f32 = 0.469;
241 pub const HEART_THINK_Q16: i32 = 30736;
242 pub const HEART_SPEAK: f32 = 0.313;
243 pub const HEART_SPEAK_Q16: i32 = 20513;
244 pub const HEART_EASE_SPEAK_MS: u32 = 80;
245 pub const HEART_EASE_MS: u32 = 400;
246}
247
248pub mod boot {
249 #[allow(unused_imports)]
250 use super::{Bezier, Rgb};
251 pub const HOLES_APPEAR_MS: u32 = 2600;
252 pub const FADE_END_MS: u32 = 6800;
253 pub const SPIRAL_MS: u32 = 6000;
254 pub const MERGE_MS: u32 = 12000;
255 pub const RIPPLE_RUN_MS: u32 = 3600;
256 pub const GONE_MS: u32 = 15200;
257 pub const ALLEN_BORN_MS: u32 = 12300;
258 pub const ALLEN_FORMED_MS: u32 = 15300;
259 pub const CENTRE_X: f32 = 0.5;
260 pub const CENTRE_X_Q16: i32 = 32768;
261 pub const CENTRE_Y: f32 = 0.4;
262 pub const CENTRE_Y_Q16: i32 = 26214;
263}
264
265pub mod sound {
266 #[allow(unused_imports)]
267 use super::{Bezier, Rgb};
268 pub const CHIRP_RATE_HZ: u32 = 48000;
269 pub const CHIRP_FROM_HZ: u32 = 200;
270 pub const CHIRP_TO_HZ: u32 = 1000;
271 pub const CHIRP_PEAK: f32 = 0.7;
272 pub const CHIRP_PEAK_Q16: i32 = 45875;
273 pub const CHIRP_IN_MS: u32 = 40;
274 pub const CHIRP_RISE_MS: u32 = 600;
275 pub const CHIRP_START_MS: u32 = 11400;
276 pub const CHIRP_END_MS: u32 = 12300;
277}
278
279pub mod contrast {
280 #[allow(unused_imports)]
281 use super::{Bezier, Rgb};
282 pub const PRIMARY_ON_NIGHT: u32 = 7;
283 pub const HINT_ON_NIGHT: f32 = 4.5;
284 pub const HINT_ON_NIGHT_Q16: i32 = 294912;
285 pub const FAINT_ON_NIGHT: f32 = 4.5;
286 pub const FAINT_ON_NIGHT_Q16: i32 = 294912;
287 pub const MIST_ON_PANEL: f32 = 4.5;
288 pub const MIST_ON_PANEL_Q16: i32 = 294912;
289 pub const PRIMARY_ON_LIT: f32 = 4.5;
290 pub const PRIMARY_ON_LIT_Q16: i32 = 294912;
291 pub const WARM_ON_NIGHT: f32 = 4.5;
292 pub const WARM_ON_NIGHT_Q16: i32 = 294912;
293 pub const GLOW_ON_NIGHT: f32 = 4.5;
294 pub const GLOW_ON_NIGHT_Q16: i32 = 294912;
295 pub const PRIMARY_ON_PANEL: u32 = 7;
296 pub const WARM_SOFT_ON_LIT: f32 = 4.5;
297 pub const WARM_SOFT_ON_LIT_Q16: i32 = 294912;
298}
299
300pub mod drawn_alpha {
301 #[allow(unused_imports)]
302 use super::{Bezier, Rgb};
303 pub const HINT: f32 = 1.0;
304 pub const HINT_Q16: i32 = 65536;
305 pub const FAINT: f32 = 1.0;
306 pub const FAINT_Q16: i32 = 65536;
307}
308
309pub mod kernel_today_alpha {
310 #[allow(unused_imports)]
311 use super::{Bezier, Rgb};
312 pub const HINT: f32 = 0.586;
313 pub const HINT_Q16: i32 = 38404;
314 pub const FAINT: f32 = 0.43;
315 pub const FAINT_Q16: i32 = 28180;
316}
317
318pub mod reduced_motion {
319 #[allow(unused_imports)]
320 use super::{Bezier, Rgb};
321 pub const NIGHT: &str = "still";
322 pub const LETTER_MS: u32 = 0;
323 pub const WORD_RISE_MS: u32 = 0;
324 pub const STATE_BLEND_MS: u32 = 150;
325 pub const DUSK_MS: u32 = 400;
326 pub const BREATH_DEPTH: f32 = 0.0;
327 pub const BREATH_DEPTH_Q16: i32 = 0;
328 pub const THINK_PULSE_PERIOD_MS: u32 = 0;
329}
330
331pub mod keys {
332 #[allow(unused_imports)]
333 use super::{Bezier, Rgb};
334 pub const NEXT: &str = "ArrowDown ArrowRight Tab";
335 pub const PREVIOUS: &str = "ArrowUp ArrowLeft Shift+Tab";
336 pub const CHOOSE: &str = "Enter Space";
337 pub const NOT_NOW: &str = "Escape";
338 pub const SPEAK: &str = "any letter";
339}