INNER CODE UNIT · Rust

Color32

David-OConnor/plascad · src/gui/mod.rs:78

pub const COLOR_SEQ_DIMMED: Color32 = Color32::from_rgb(140, 160, 165); // Eg dim when there are search results
pub const COLOR_RE: Color32 = Color32::LIGHT_RED;
pub const COLOR_RE_HIGHLIGHTED: Color32 = Color32::YELLOW;

// If using a dedicated canvas for a linear map.
pub const LINEAR_MAP_HEIGHT: f32 = 60.;

pub fn int_field(val: &mut usize, label: &str, ui: &mut Ui) {
    ui.label(label);
    let mut entry = val.to_string();
    if ui
        .add(TextEdit::singleline(&mut entry).desired_width(40.))
        .changed()
    {
        *val = entry.parse().unwrap_or(0);
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…