aboutsummaryrefslogtreecommitdiff
path: root/thcolor/builtin/_css.py
diff options
context:
space:
mode:
Diffstat (limited to 'thcolor/builtin/_css.py')
-rwxr-xr-xthcolor/builtin/_css.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/thcolor/builtin/_css.py b/thcolor/builtin/_css.py
index f60cdaa..ac9e434 100755
--- a/thcolor/builtin/_css.py
+++ b/thcolor/builtin/_css.py
@@ -309,24 +309,17 @@ class CSS3Reference(CSS2Reference):
# Functions.
# ---
+ @_Reference.alias('rgba')
def rgb(self, r: number | percentage,
g: number | percentage = number(0), b: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (0, 1, 2))
- def rgba(self, r: number | percentage,
- g: number | percentage = number(0), b: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (0, 1, 2))
-
+ @_Reference.alias('hsla')
def hsl(self, h: number | angle, s: number | percentage,
l: number | percentage, alpha: number | percentage = number(1.0)):
return self._hsl((h, s, l, alpha), (0, 1, 2))
- def hsla(self, h: number | angle, s: number | percentage,
- l: number | percentage, alpha: number | percentage = number(1.0)):
- return self._hsl((h, s, l, alpha), (0, 1, 2))
-
class CSS4Reference(CSS3Reference):
""" Named colors and functions from `CSS Color Module Level 4
<https://drafts.csswg.org/css-color/>`_. """
@@ -386,16 +379,12 @@ class CSS4Reference(CSS3Reference):
# Functions.
# ---
+ @_Reference.alias('hwba')
def hwb(self, h: number | angle, w: number | percentage = number(0),
b: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._hwb((h, w, b, alpha), (0, 1, 2))
- def hwba(self, h: number | angle, w: number | percentage = number(0),
- b: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._hwb((h, w, b, alpha), (0, 1, 2))
-
def gray(self, g: number | percentage,
alpha: number | percentage = number(1.0)):
try: