Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 562 Bytes

raw-color-values.md

File metadata and controls

29 lines (22 loc) · 562 Bytes

Obtaining RGB values

You can use the following snippet to get the raw RGB values from a color.

#rgbify(@color) {
  @rgb: red(@color), green(@color), blue(@color);
}
--ctp-base: #rgbify(@base) []; // -> 30, 30, 46

Obtaining HSL values

You can use the following snippet to get the raw HSL values from a color.

#hslify(@color) {
  @raw: e(
    %("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color))
  );
}
--ctp-base: #hslify(@base) []; // -> 240, 21.052631578947366%, 14.901960784313726%