https://github.com/pardnchiu/sass-functions
Sass Function: 邱敬幃 Pardn Chiu
https://github.com/pardnchiu/sass-functions
sass-functions
Last synced: 4 months ago
JSON representation
Sass Function: 邱敬幃 Pardn Chiu
- Host: GitHub
- URL: https://github.com/pardnchiu/sass-functions
- Owner: pardnchiu
- Created: 2024-08-09T03:13:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-10T16:08:10.000Z (11 months ago)
- Last Synced: 2024-11-08T04:35:07.382Z (8 months ago)
- Topics: sass-functions
- Language: SCSS
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sass-functions
This code includes two SCSS functions, `hsba` and `hsb`, used to convert HSB (Hue, Saturation, Brightness) color values to HSLA (Hue, Saturation, Lightness, Alpha) color values. Below is a brief introduction to each function:
### @function hsba($hue, $saturation, $brightness, $alpha: 1):
Calculates `$x` and `$l`, which represent intermediate variables and lightness, respectively. Based on different `$x` values, it calculates saturation `$saturation` and then returns the corresponding `hsla` value.
### @function hsb($hue, $saturation, $brightness):
Calls the `hsba` function with the alpha set to 1.
These functions are mainly used to convert HSB colors to HSLA colors supported by CSS, making them convenient for use in styles.