2022-10-03 14:51:13 +02:00
|
|
|
import { darken, lighten, isDark } from 'khroma';
|
2022-09-28 17:49:47 +02:00
|
|
|
|
2022-10-03 14:51:13 +02:00
|
|
|
const genSections = (options) => {
|
|
|
|
let sections = '';
|
|
|
|
|
|
|
|
for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
|
|
|
|
sections += `
|
|
|
|
.section-${i} rect {
|
|
|
|
fill: ${options['cScale' + i]};
|
|
|
|
stroke: ${options['cScalePeer' + i]};
|
|
|
|
stroke-width: 4;
|
|
|
|
}
|
|
|
|
.section-${i} rect.inverted {
|
|
|
|
fill: ${options['cScaleInv' + i]};
|
|
|
|
}
|
|
|
|
.section-${i} text {
|
|
|
|
fill: ${options['cScaleLabel' + i]};
|
|
|
|
}
|
|
|
|
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
return sections;
|
|
|
|
};
|
|
|
|
|
|
|
|
const getStyles = (options) =>
|
|
|
|
`
|
|
|
|
${genSections(options)}
|
|
|
|
`;
|
2022-09-28 17:49:47 +02:00
|
|
|
export default getStyles;
|