How to use the vuestic-ui/src/services/color-functions.hex2hsl function in vuestic-ui

To help you get started, we’ve selected a few vuestic-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github epicmaxco / vuestic-admin / src / services / vuestic-ui / index.js View on Github external
const colorShiftHsl = (main, offset = { h: 0, s: 0, l: 0 }) => {
  offset = {
    h: offset.h || 0,
    s: offset.s || 0,
    l: offset.l || 0,
  }

  const color = hex2hsl(main)

  const normalizeParam = (value, params = { start: 0, end: 100 }) =>
    value < params.start
      ? params.start
      : value > params.end
        ? params.end
        : value

  color.h = normalizeParam(color.h + offset.h, { end: 360 })
  color.s = normalizeParam(color.s + offset.s)
  color.l = normalizeParam(color.l + offset.l)

  return color
}

vuestic-ui

Vue 3 UI Framework

MIT
Latest version published 2 months ago

Package Health Score

93 / 100
Full package analysis