Skip to main content

part_color

Function part_color 

pub fn part_color(
    color: [f32; 3],
    highlight: f32,
    heat: Option<f32>,
) -> [f32; 3]
Expand description

The part colours live in the core, so that the browser’s 3D view (sim-wasm) colours as this one does. The colour a 3D view draws a part in: where its warmth is computed (Part::heat) the heat scale in its place; otherwise its own colour, shifted towards red by belt tension above pretension (highlight up to 1, at twice the pretension) and towards blue below it (-1 at no tension).