KCL: [number; 3] to RGB hex string color function (#7184)

Closes https://github.com/KittyCAD/modeling-app/issues/6805. Enables users to programatically construct colors, which will be helpful for 

- Applying color to visualize program execution and help debugging
- Doing weird cool shit
This commit is contained in:
Adam Chalmers
2025-05-23 13:53:58 -05:00
committed by GitHub
parent 034366e65e
commit 1f53dd1357
17 changed files with 285 additions and 3 deletions

View File

@ -286,7 +286,13 @@ pub(crate) fn std_fn(path: &str, fn_name: &str) -> (crate::std::StdFn, StdFnProp
|e, a| Box::pin(crate::std::patterns::pattern_transform_2d(e, a)),
StdFnProps::default("std::sketch::patternTransform2d"),
),
_ => unreachable!(),
("appearance", "hexString") => (
|e, a| Box::pin(crate::std::appearance::hex_string(e, a)),
StdFnProps::default("std::appearance::hexString"),
),
(module, fn_name) => {
panic!("No implementation found for {module}::{fn_name}, please add it to this big match statement")
}
}
}