v2.4.39
New utility functions
The following set of tested utility functions are now available:
import {
abbreviate,
darkenColor,
lightenColor,
shiftColorHue
} from "vue-data-ui";
Documentation website is up to date
abbreviate
Generate abbreviations for labels
import { abbreviate } from "vue-data-ui";
const text = "Lorem Ipsum Dolor Sit Amet";
const abbreviated = abbreviate(text, 5); // result: "LIDSA"
darkenColor
Darkens a color by a specified strength.
The color passed can be in HEX (with or without alpha channel), RGB or RGBA, or named color.
import { darkenColor } from "vue-data-ui";
const color = "#FF0000";
const darkened = darkenColor(color, 0.1);
lightenColor
import { lightenColor } from "vue-data-ui";
Lightens a color by a specified strength.
The color passed can be in HEX (with or without alpha channel), RGB or RGBA, or named color.
const color = "#FF0000";
const lightened = lightenColor(color, 0.1);
shiftColorHue
Shifts hue for a given color, by a given strength.
The color passed can be in HEX (with or without alpha channel), RGB or RGBA, or named color.
import { shiftColorHue } from "vue-data-ui";
const color = "#FF0000";
const shifted = shiftColorHue(color, 0.1);