mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-30 04:39:03 +01:00
Add color.whiteness() and color.blackness() functions (#1110)
See sass/sass#2834 See #1089
This commit is contained in:
parent
a56750b71b
commit
7ba5128423
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,5 +1,16 @@
|
||||
## 1.28.0
|
||||
|
||||
* Add a [`color.hwb()`] function to `sass:color` that can express colors in [HWB] format.
|
||||
|
||||
[`color.hwb()`]: https://sass-lang.com/documentation/modules/color#hwb
|
||||
[HWB]: https://en.wikipedia.org/wiki/HWB_color_model
|
||||
|
||||
* Add [`color.whiteness()`] and [`color.blackness()`] functions to `sass:color`
|
||||
to get a color's [HWB] whiteness and blackness components.
|
||||
|
||||
[`color.whiteness()`]: https://sass-lang.com/documentation/modules/color#whiteness
|
||||
[`color.blackness()`]: https://sass-lang.com/documentation/modules/color#blackness
|
||||
|
||||
### Dart API
|
||||
|
||||
* Add [HWB] support to the `SassColor` class, including a `SassColor.hwb()`
|
||||
|
@ -281,6 +281,18 @@ final module = BuiltInModule("color", functions: [
|
||||
}
|
||||
}),
|
||||
|
||||
_function(
|
||||
"whiteness",
|
||||
r"$color",
|
||||
(arguments) =>
|
||||
SassNumber(arguments.first.assertColor("color").whiteness, "%")),
|
||||
|
||||
_function(
|
||||
"blackness",
|
||||
r"$color",
|
||||
(arguments) =>
|
||||
SassNumber(arguments.first.assertColor("color").blackness, "%")),
|
||||
|
||||
// ### Opacity
|
||||
_removedColorFunction("opacify", "alpha"),
|
||||
_removedColorFunction("fade-in", "alpha"),
|
||||
|
Loading…
Reference in New Issue
Block a user