mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 18:45:55 +00:00
Curvature comb: purple envelope and orange teeth from their own theme tokens
comb_envelope and comb_teeth in the light and dark palettes (legible on each view background), themable from a theme file, measured by the colour vision tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -230,6 +230,8 @@ impl Tokens {
|
||||
bend_up: Color32::from_rgb(30, 140, 50),
|
||||
bend_down: Color32::from_rgb(200, 90, 20),
|
||||
interference: Color32::from_rgb(235, 45, 40),
|
||||
comb_envelope: Color32::from_rgb(130, 40, 175),
|
||||
comb_teeth: Color32::from_rgb(215, 105, 0),
|
||||
continuity: [
|
||||
Color32::from_rgb(0, 158, 115),
|
||||
Color32::from_rgb(0, 114, 178),
|
||||
@@ -365,6 +367,8 @@ impl Tokens {
|
||||
t.box_crossing = Color32::from_rgb(80, 200, 120);
|
||||
t.bend_up = Color32::from_rgb(110, 200, 120);
|
||||
t.bend_down = Color32::from_rgb(240, 150, 80);
|
||||
t.comb_envelope = Color32::from_rgb(195, 130, 255);
|
||||
t.comb_teeth = Color32::from_rgb(255, 160, 60);
|
||||
t.form_ink = t.text;
|
||||
t.form_dim = Color32::from_rgb(180, 187, 200);
|
||||
t.form_primary = t.accent;
|
||||
|
||||
@@ -293,6 +293,7 @@ fn groups(t: &Tokens) -> Vec<Group> {
|
||||
// Every axis drawn: origin, view triad, navigation cube, Move gizmo… (one set, #976).
|
||||
group("axes", &[("axis_x", t.axis_x), ("axis_y", t.axis_y), ("axis_z", t.axis_z)], &[("viewport_top", t.viewport_top)]),
|
||||
group("bend lines", &[("bend_up", t.bend_up), ("bend_down", t.bend_down)], &[("viewport_top", t.viewport_top)]),
|
||||
group("curvature comb", &[("comb_envelope", t.comb_envelope), ("comb_teeth", t.comb_teeth)], &[("viewport_top", t.viewport_top)]),
|
||||
group("box select", &[("box_window", t.box_window), ("box_crossing", t.box_crossing)], &[("viewport_top", t.viewport_top)]),
|
||||
group(
|
||||
"selection",
|
||||
|
||||
@@ -490,10 +490,10 @@ fn combs(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {
|
||||
let mut tips: Vec<Pos2> = Vec::new();
|
||||
for [a, b] in comb {
|
||||
let (Some(p), Some(q)) = (proj.to_screen(*a), proj.to_screen(*b)) else { continue };
|
||||
painter.line_segment([p, q], Stroke::new(1.0, tk.warning.gamma_multiply(0.8)));
|
||||
painter.line_segment([p, q], Stroke::new(1.0, tk.comb_teeth));
|
||||
tips.push(q);
|
||||
}
|
||||
painter.add(egui::Shape::line(tips, Stroke::new(1.4, tk.warning)));
|
||||
painter.add(egui::Shape::line(tips, Stroke::new(1.4, tk.comb_envelope)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -811,6 +811,10 @@ pub struct Tokens {
|
||||
pub bend_down: Color32,
|
||||
/// Interference: the clash fill, before its shading.
|
||||
pub interference: Color32,
|
||||
/// Curvature Comb: the envelope through the teeth tips (purple) and the teeth, the scaled
|
||||
/// normals (orange).
|
||||
pub comb_envelope: Color32,
|
||||
pub comb_teeth: Color32,
|
||||
/// Continuity Analysis seams, best to worst as `inspect.continuity` judges them: smooth (G2),
|
||||
/// tangent with a curvature jump (G1), a crease (G0) and a gap. Bluish green, blue, yellow
|
||||
/// and reddish purple stay apart in every colour vision mode, so no mode changes them.
|
||||
@@ -920,6 +924,8 @@ impl Tokens {
|
||||
bend_up: view.bend_up,
|
||||
bend_down: view.bend_down,
|
||||
interference: view.interference,
|
||||
comb_envelope: view.comb_envelope,
|
||||
comb_teeth: view.comb_teeth,
|
||||
continuity: view.continuity,
|
||||
analysis: view.analysis,
|
||||
..self
|
||||
|
||||
@@ -309,7 +309,7 @@ theme_keys! {
|
||||
sketch_point, sketch_point_free, dialog_bg, dialog_border, chip, section_cap,
|
||||
profile_fill, glyph_bg, glyph_edge, glyph_text, overlay, rubber_band, app_bar_text, app_bar_hover, timeline_item,
|
||||
timeline_item_error, timeline_marker, field, box_window, box_crossing, sketch_projected, sketch_lost,
|
||||
sketch_construction, sketch_centerline, bend_up, bend_down, interference,
|
||||
sketch_construction, sketch_centerline, bend_up, bend_down, interference, comb_envelope, comb_teeth,
|
||||
sketch_ink, sketch_soft, surface_fill, surface_ink, surface_soft, mesh_fill, mesh_ink, mesh_soft, form_fill, form_tab_ink, form_soft, sheet_fill, sheet_ink, sheet_soft, render_fill, render_ink, render_soft, tab_on_fill_dark,
|
||||
app_bar_separator, surface_accent, mesh_accent, form_accent, render_accent, on_accent, agent_ok, agent_busy, app_bar_hover_subtle,
|
||||
app_bar_hover_button, app_bar_hover_strong, app_bar_tab_active,
|
||||
|
||||
Reference in New Issue
Block a user