1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
//! **The seat's mark**: the congeries as a circuit — the same picture the
//! phone seat wears, because the two seats are two faces of one product
//! (operator ruling, bl-708e). Until then this module argued the opposite —
//! that a program must not share a picture with another — and drew a ring, a
//! disc and a wire of its own. That doctrine is withdrawn: the SERVER keeps a
//! mark of its own; every seat of it wears this one.
//!
//! **What the picture is.** Three circles sit tangent to a central one, 120°
//! apart with one at bottom dead centre. From each, an arm runs 60° of arc to
//! a further circle; the circles between ride that arc, joined by a trace of
//! dim casing under a bright phosphor conductor. The centre carries a slit
//! pupil in the void's own black. Two hues, both driven from one palette
//! entry — the theme's attention green — on the theme's ground.
//!
//! **Everything is compass work.** No spline, no easing: an arc is named by
//! two endpoints and the height of its apex above the chord (`arc::arc`). The
//! pupil is a *lune*, the sliver between two arcs sharing a pair of endpoints,
//! pointed at each end because that is where the arcs meet — and it is
//! **filled, not punched**: cut as negative space it showed the traces
//! converging beneath it.
//!
//! # One walk, three emissions
//!
//! [`mark`] is the shape list, and it is the phone's walk constant for
//! constant: the same `Trace` / `Lune` / `Disc` vocabulary in the same layer
//! order, so the two seats' marks are one geometry rather than two drawings
//! of one idea. [`icon`] is that list over a round ground, which is the
//! phone's launcher mask — so the two icons read alike on a desk and on a home
//! screen. [`svg`] emits the checked-in vector source from `icon`, [`rgba`]
//! rasterizes the same list for the toolkit's own icon call, and the window
//! says the bare `mark` in egui's words (`ui::shell`). `tests::artifacts`
//! pins the checked-in file against the generator byte for byte, so
//! `assets/lernie.svg` is a **derivation**, never a hand-edit.
//!
//! # The walk is `f32`, and nothing narrows
//!
//! The phone's walk is single-precision trigonometry and so is this one —
//! porting it to integers would be a second geometry wearing the first's name.
//! What the house lint set denies is the `as` cast, and there is no home for a
//! suppression but the manifest, so the port avoids casts by construction:
//! pixel coordinates widen through `f32::from(u16)`, counts narrow through
//! `u8::try_from`, the raster's coverage is an integer count of subsamples
//! rather than a distance passed through a curve, and the hue drive
//! ([`deep`]) is fixed-point integer arithmetic that lands on the phone's own
//! bytes. The one place a float becomes text is the vector source, written at
//! a fixed precision so a last-bit difference between targets does not reach
//! the file — the same discipline the phone's drawable keeps.
//!
//! # Where the mark actually shows, which is not where you would guess
//!
//! **Wayland has no protocol for a client to set its own window icon.** The
//! toolkit's icon call reaches X11 and nothing else; a Wayland compositor
//! resolves a window's mark by matching its **application id** against an
//! installed desktop entry, and then the entry's `Icon=` by NAME through the
//! hicolor theme. So the seat needs three things to agree — the app id
//! [`APP_ID`] that `main.rs` hands the toolkit, the entry's `StartupWMClass`,
//! and the basename of the installed SVG — and `make icon-seats` is what lays
//! the last two down. `tests::artifacts` pins the agreement, because a mark
//! that resolves nowhere fails silently and looks exactly like not having one.
//!
//! **And it needs no PNG, which is why this repository still tracks no
//! binary.** hicolor's scalable directory is read by every desktop this seat
//! is installed on; the SVG is text the disclosure gate reads, so the gate's
//! binary allowlist stays the empty set.
/// Compass work: arcs, lunes, and the shape vocabulary.
/// The pixel loop.
/// The vector emitter.
use lune;
pub use ;
/// **The application id**, which is the whole of what a Wayland compositor has
/// to go on. It is the crate's own name because the desktop entry and the
/// installed icon are named for the crate too, and the three agreeing is the
/// only reason any of them is seen.
pub const APP_ID: &str = "lernie";
/// A flat fill, RGB — the walk's whole colour vocabulary. Every fill is
/// opaque; transparency is the canvas's, and coverage is the raster's.
pub type Hue = ;
/// The one palette entry the mark is built from, and the void its pupil and
/// ground are filled with — the theme's attention green and its ground,
/// restated here because the walk is pure and links no toolkit. `tests`
/// holds the two spellings to one another.
const HYDRA: Hue = ;
const VOID_DEEP: Hue = ;
/// Arms, and the degrees between them — the triskele's three-fold turn.
const ARMS: u8 = 3;
const TURN: f32 = 120.0;
/// Points sampled along one arc. Divisible by `CIRCLES - 1`, so the seats
/// fall on sampled points exactly rather than between them.
const STEPS: u16 = 48;
/// Where the first arm's tangent circle sits, in degrees: bottom dead centre.
const BASE: f32 = 90.0;
/// The middle circle, and the radius of every other circle — all equal.
const MAIN_R: f32 = 0.132;
const NODE_R: f32 = 0.048;
/// An arm ends this far out, and this many degrees of arc from where it
/// began — the pair that puts the top-right arm's last circle straight up.
const END_R: f32 = 0.398;
const SWEEP: f32 = 60.0;
/// Circles an arm, counting the tangent one it starts on and the one it ends
/// on.
const CIRCLES: u8 = 3;
/// **The only free parameter.** The sagitta of an arm's arc, as a fraction
/// of the chord between its two pinned ends: at 0.448 the arm leaves its
/// tangent circle at exactly 45° off the radial.
const SWELL: f32 = 0.448;
/// The dim casing, and the bright conductor laid down its middle.
const CASING_W: f32 = 0.054;
const CONDUCTOR_W: f32 = 0.016;
/// The pupil's half-height and bulge, as fractions of the middle circle.
const PUPIL_LONG: f32 = 0.78;
const PUPIL_BULGE: f32 = 0.30;
/// How hard [`deep`] drives the one hue, in hundredths: the conductor past
/// the hue's own peak until it is phosphor, the casing well under it.
const PHOSPHOR: i64 = 115;
const CASING: i64 = 45;
/// How much of the palette hue's white component [`deep`] strips, in
/// hundredths.
const WHITE_CUT: i64 = 85;
/// The palette hue with its white component stripped and its value scaled by
/// `value` hundredths. The badge hue is pastel — tuned to read as a small
/// mark on a dark panel — and a logo wants it saturated; driven past 1.0 the
/// green goes phosphor.
///
/// The phone computes this in `f32` and truncates; here the same sum is taken
/// in hundredths over `i64`, truncating the same way, and lands on the same
/// bytes — `tests` pins them — without the `as u8` the truncation would
/// otherwise end in.
/// The unit-square point `radius` out from the centre at `degrees`.
/// One arm's two **pinned** points: a circle tangent to the middle one, and
/// a circle [`SWEEP`] degrees of arc counter-clockwise of it at [`END_R`].
/// The arc between them, bowed by [`SWELL`] of the chord.
/// Where an arm's circles sit: [`CIRCLES`] points spaced evenly along its
/// arc. Even spacing on a circular arc means equal chords, so the legs
/// between them come out equal without anyone asking.
/// A flat circle in the walk's words.
/// **The whole mark at rest, back to front — by layer, not by arm**: every
/// casing goes down, then every conductor, then every circle, then the eye
/// over the place the arms converge. Drawing each arm complete in turn looks
/// equivalent and is not — the arms overlap near the middle, so a later
/// one's casing would paint over an earlier one's conductor.
///
/// Coordinates are the unit square; a renderer maps them to whatever rect it
/// holds, keeping the square (the mark is round, and a stretched one is a
/// different picture). The canvas is whatever is under it: the window's
/// panel, or [`icon`]'s ground.
/// **The icon**: the mark over a round ground in the void, which is the shape
/// a phone's launcher mask cuts — so a desk and a home screen show one
/// picture. The ground is the first shape because the walk is painted back to
/// front, and the mark's furthest ink (`END_R + NODE_R` = 0.446 from the
/// centre) sits inside the ground's 0.5.
/// **The vector source**, which is the file `assets/lernie.svg` must equal:
/// one element per shape of [`icon`], in the walk's order.
/// **The icon rasterized `size`×`size`** as straight-alpha RGBA8, row-major
/// from the top-left — the format the toolkit's icon call takes.