refactor(treewide): cleanup and use rgbify mixin (#1511)
This commit is contained in:
1 parent
a53832420b
commit
7acf913ebc
27 files changed
+76
-72
No files matched your search
@@ -4,4 +4,4 @@
|
||||
|
||||
- [Images and SVGs](./images-and-svgs.md)
|
||||
- [Syntax highlighting](./syntax-highlighting.md)
|
||||
- [Extracting RGB values](./rgb-values.md)
|
||||
- [Obtaining raw color values](./raw-color-values.md)
|
||||
@@ -0,0 +1,29 @@
|
||||
## Obtaining RGB values
|
||||
|
||||
You can use the following snippet to get the raw RGB values from a color.
|
||||
|
||||
```less
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
```
|
||||
|
||||
```less
|
||||
--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.
|
||||
|
||||
```less
|
||||
#hslify(@color) {
|
||||
@raw: e(
|
||||
%("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color))
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
```less
|
||||
--ctp-base: #hslify(@base) []; // -> 240, 21.052631578947366%, 14.901960784313726%
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
You can use the following snippet to get the raw RGB values from a color.
|
||||
|
||||
```less
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
--ctp-base: #rgbify(@base) []; // -> 30, 30, 46
|
||||
```
|
||||
Reference in new issue
Block a user