You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently axs uses palx to generate the palette. When working on an existing design using incremental refactor, I must use our brand colors. However palx only accept the main color. It would be a greet improvement to expose functions to generate the palette (especially the shades).
import{config,palette}from"axs"// Possible API satisfying the need:config.set({colors: palette({orange: "#ff8000",red: "#d62828",green: "#128811",blue: "#2f638b",})})
The text was updated successfully, but these errors were encountered:
EDIT#1: palx needs to be extended... or add a short script to the axs source.
I can see two ways to solve this issue:
palx includes an options param which is currently unused but could be leveraged to pass in new theme colors. On line 93, add the following snippet to enable passing your own colors.
With this implementation you could just call palx('#07c', {orange: '#ff8000'}).
But because orange is already defined in the defaults, the new orange would be renamed to orange2 instead of replacing the default. You can see why on line 63.
An alternative would be to extend axs by adopting the relevant features from palx into a new script.
Implementing this would mean that updating your configuration would look like this:
This would overwrite any of the existing orange and red values while retaining the rest of the palette.
I believe the first approach (updating palx) would be more tidy and appropriate. It's also just as easy to add a { replace: true } flag in options to allow overwriting defaults.
Currently
axs
usespalx
to generate the palette. When working on an existing design using incremental refactor, I must use our brand colors. Howeverpalx
only accept the main color. It would be a greet improvement to expose functions to generate the palette (especially the shades).The text was updated successfully, but these errors were encountered: