refactor(treewide): cleanup and use rgbify mixin (#1511)

This commit is contained in:
uncenter authored and GitHub committed 2024-12-24 16:45:33 -05:00
1 parent a53832420b
commit 7acf913ebc
27 files changed
+76 -72

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
- [Images and SVGs](./guide/images-and-svgs.md)
- [Syntax highlighting](./guide/syntax-highlighting.md)
- [Extracting RGB values](./guide/rgb-values.md)
- [Obtaining raw color values](./guide/raw-color-values.md)
- [Tutorials](./tutorials/README.md)
+1 -1
View File
@@ -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)
+29
View File
@@ -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%
```
-9
View File
@@ -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
```