icon-rs
SVG icons for CAD apps, embedded as Rust constants. Four kinds, drawn procedurally so the set stays consistent:
- Solid: shaded isometric features, mates, relations and document types.
- Sketch: flat sketch tools, with the points the user picks in the accent colour.
- Glyph: bold sketch constraints and viewport markers, legible at 10-16 px.
- Line: interface icons.
Glyph and line icons are drawn in ink with a small accent detail, so apps can tint them.
Browse the icons and try out palettes: https://rvdende.github.io/icon-rs/
use ;
let light: &str = EXTRUDE.svg; // for light backgrounds
let dark: &str = EXTRUDE.svg_dark; // for dark backgrounds
let svg = get.unwrap.themed;
// Any other theme: a line colour and an accent. Faces are neutral tints of the line.
let palette = new;
let custom: String = EXTRUDE.recolor;
// Glyph and line icons are ink plus a little accent: paint the ink any colour.
assert!;
let white: String = UNDO.tinted;
Bevy
Enable the bevy_color feature to pass Bevy colours straight in and get them back out:
= { = "0.2", = ["bevy_color"] }
use ;
let palette = new;
let mid: Color = palette.mid.into;
Colours convert through sRGB; alpha is dropped, since icons are opaque.
icons/*.svg,icons/dark/*.svg: 24x24, generated; don't edit by hand.tools/icons/: the generator.common.pyholds the palette, conventions and geometry helpers; each family is one module (part,assembly,sketch,glyphs,ui_a,ui_b).python3 tools/icons/gen.pyvalidates every icon and rewritesicons/andsrc/generated.rs.cargo run --release --example sheet -- OUT.png icons [NAME...]: a labelled review sheet at 96, 24 and 16 px in both themes.tools/build_site.py: builds the icon browser intosite/; GitHub Actions deploys it on every push tomain.cargo run --example preview [out.png] [scale]: renders a contact sheet (defaulttarget/preview.png).