Color Picker

Here we are using 3 sliders for the hue, saturation and lightness values.

The color is then calculated using the hsl() function and placed into the style="" property as a css variable.

El Classico / Color Sliders
h: 122°
s: 60%
l: 90%
--hue: 122deg; --saturation: 60%; --lightness: 90%;
/** border and frame for the color ui */
.color {
  padding: 1em;
  background-color: var(--color);
  transition: all 0.5s ease;
}

/** color picker slider */
.color-ui .rangeSlider.rangeSlider {
  margin-block: 2em;
  /* replace the default accent colors with the color from JS */
  --slider-accent: var(--picker-color);
  --slider-accent-100: var(--picker-color);
}

/** always show the floating values, and place them over the handles */
.color-ui .rangeSlider.rangeSlider .rangeFloat,
.color-ui .rangeSlider.rangeSlider.rsFocus .rangeFloat,
.color-ui .rangeSlider.rangeSlider:hover .rangeFloat {
  opacity: 1;
  translate: -50% 100%;
  border-radius: 1em;
  padding: .5em .75em;
  pointer-events: all;
}


/** Simple Styling for the outer UI */
.color-ui {
  border-radius: 0.5rem;
  border: 2px solid var(--color);
  color: var(--color);
  transition: all 0.5s ease;
  user-select: none;
  font-family: var(--font-mono);
}

/** Advanced css to invert the text color and add a vibrant shadow */
.color-ui {
  color: hsla(var(--hue), calc( var(--saturation) / 2),calc( (var(--lightness ) - 50%) * -1 + 100% ), 1);
  text-shadow: 0 1px 1px hsla(var(--hue), calc( var(--saturation) / 2),calc( var(--lightness ) - 50% ), 1);
  box-shadow: 
    0 1px 1px 2px hsla(var(--hue), calc( var(--saturation) / 2), max( calc( var(--lightness ) - 10% ), 30% ), 1),
    0 4px 4px 1px hsla(var(--hue), calc( var(--saturation) / 2), max( calc( var(--lightness ) - 10% ), 30% ), .5),
    0 8px 10px 5px hsla(var(--hue), calc( var(--saturation) / 2), max( calc( var(--lightness ) - 10% ), 30% ), .5);
}