Skip to main content

flat_material_colors

Function flat_material_colors 

Source
pub fn flat_material_colors(
    element_material_colors: &FxHashMap<u32, Vec<[f32; 4]>>,
) -> (Vec<u32>, Vec<u32>, Vec<u8>)
Expand description

Flat wire encoding of the element material colour lists (#407/#913 §2.3): (element_ids, counts, rgba8)counts[i] colours belong to element_ids[i], in order, 4 bytes each.

Emitted sorted by element id (u32 ascending) - same explicit-order wire contract as flat_voids; the per-element colour list order (file order) is unchanged. The inverse material_colors_from_flat rebuilds a map, so consumers are order-insensitive.