I have a colors.less file that maintains consistent color palette for a site.
I also have a chart.js file that requires hard coded colors to display chart elements in appropriate colors.
How can I make the chart colors dependent on the generated colors.css file?
So far I've been maintaining two color palettes, one in less and another in js. How can I merge the two?
Example:
/* colors.less */
@green: #46a546;
@red: #9d261d;
@yellow: #f1c40f;
and
/* chart.js */
var chartElements = {
"apples": {
label: "Apples",
color: "#46a546",
},
"oranges": {
label: "Oranges",
color: "#f1c40f",
},
"grapes": {
label: "Grapes",
color: "#9d261d",
}...
How can I stop maintaining both sets of colors?