A Js library to provide style-related functionalities.
A Js function to convert HEX colors into RGB colors. The reason is explained here.
Import the hexToRgbaCustomVariables method and use it passing as parameter an object where each key is a color name and each value is a hex color value.
import { hexToRgbaCustomVariables } from "@/../ditto/style";
hexToRgbaCustomVariables({
primary: "#3477A3",
secondary: "#D9B60A",
accent: "#30B052",
anchor: "#3477A3",
black: "#262626",
grey: "#EAEAEA"
});
This methods generates a RGB custom variable for each hex color, that you can use into css files as follows:
.your-class {
color: rgba(var(--v-primary-rgb), 1);
background: rgba(var(--v-grey-rgb), 0.55);
}