);const b = parseInt(hex.slice(5, 7), 16);
return { r, g, b };
}function rgbToHex(rgb) {const hexR = rgb.r.toString(16).padStart(2, '0');
const hexG = rgb.g.toString(16).padStart(2, '0');
const hexB = rgb.b.toString(16).padStart(2, '0');
return
schemes.push({ name: 'Analogous', primary: color, secondary: getAnalogous(color, 30) });
schemes.push({ name: 'Complementary', primary: color, secondary: getComplementary(color) });
schemes.push({ name: 'Split Complementary', primary: color, secondary: getSplitComplementary(color, 30) });
schemes.push({ name: 'Triadic', primary: color, secondary: getTriadic(color) });
return schemes;
}function getAnalogous(color, angle) {const hsl = rgbToHsl(color);
const newHsl = { h: (hsl.h + angle) % 360, s: hsl.s, l: hsl.l };
const rgb = hslToRgb(newHsl);
return rgb;
}function getComplementary(color) {const hsl = rgbToHsl(color);
const newHsl = { h: (hsl.h + 180) % 360, s: hsl.s, l: hsl.l };
const rgb = hslToRgb(newHsl);
return rgb;
}function getSplitComplementary(color, angle) {const hsl = rgbToHsl(color);
const newHsl1 = { h: (hsl.h + angle) % 360, s: hsl.s, l: hsl.l };
const newHsl2 = { h: (hsl.h + 360 - angle) % 360, s: hsl.s, l: hsl.l };
const rgb1 = hslToRgb(newHsl1);
const rgb2 = hslToRgb(newHsl2);
return { r: Math.round((rgb1.r + rgb2.r) / 2), g: Math.round((rgb1.g + rgb2.g) / 2), b: Math.round((rgb1.b + rgb2.b) / 2) };
}function getTriadic(color) {const hsl = rgbToHsl(color);
const newHsl1 = { h: (hsl.h + 120) % 360, s: hsl.s, l: hsl.l };
const newHsl2 = { h: (hsl.h + 240) % 360, s: hsl.s, l: hsl.l };
const rgb1 = hslToRgb(newHsl1);
const rgb2 = hslToRgb(newHsl2);
return { r: Math.round((rgb1.r + rgb2.r) / 2), g: Math.round((rgb1.g + rgb2.g) / 2), b: Math.round((rgb1.b + rgb2.b) / 2) };
}function rgbToHsl(rgb) {const r = rgb.r / 255;
const g = rgb.g / 255;
const b = rgb.b / 255;
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);const l