function invert(color, style) {
if (typeof color === "string") {
color = parseColor(color);
}
if (style === "rgb") {
return parseColor(`rgb(${color.rgb.map((c) => 255 - c)})`).hex;
}
const [h, s, v] = color[style];
return parseColor(
`hs${style === "hsl" ? "l" : "v"}(${h}, ${v}, ${
style === "hsl" ? (s + 50) % 100 : s
})`
).hex;
}