Skip to main content

Colors

import { darken, hexToRgb, isValidHex } from '@rtorcato/js-common/colors'

Exports

NameSummary
darkenDarkens a hex color by a given percentage.
hexToRgbConverts a hex color string to an RGB object.
isValidHexConverts a hex color string to an HSL object.
lightenLightens a hex color by a given percentage.
matchingTextColorGenerates a random color with a given alpha value.
randomColorGenerates a random hex color string.
rgbToHexConverts RGB values to a hex color string.