Skip to content

v2.4.39

Compare
Choose a tag to compare
@graphieros graphieros released this 16 Dec 05:09
· 169 commits to master since this release

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);