.ai palette: color groups are capped as swatches are

This commit is contained in:
bflatastic
2026-10-24 17:46:36 +07:00
parent bd4804b4da
commit 9090afea1c
+4 -1
View File
@@ -118,7 +118,10 @@ pub(super) fn palette(data: &[u8]) -> Palette {
});
}
"Pg" => {
if let Some(name) = first_text(&vals) {
// Capped as swatches are: a file of many `Pg` would make as many empty groups.
if let Some(name) = first_text(&vals)
&& out.groups.len() < MAX_SWATCHES
{
out.groups.push((name, Vec::new()));
}
}