aboutsummaryrefslogtreecommitdiff
path: root/thcolor/builtin/_default.py
diff options
context:
space:
mode:
Diffstat (limited to 'thcolor/builtin/_default.py')
-rwxr-xr-xthcolor/builtin/_default.py43
1 files changed, 8 insertions, 35 deletions
diff --git a/thcolor/builtin/_default.py b/thcolor/builtin/_default.py
index 31b1434..dd54a2b 100755
--- a/thcolor/builtin/_default.py
+++ b/thcolor/builtin/_default.py
@@ -27,78 +27,51 @@ class DefaultReference(_CSS4Reference):
# RGB functions.
# ---
+ @_Reference.alias('rbga')
def rbg(self, r: number | percentage,
b: number | percentage = number(0), g: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (0, 2, 1))
- def rbga(self, r: number | percentage,
- b: number | percentage = number(0), g: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (0, 2, 1))
-
+ @_Reference.alias('brga')
def brg(self, b: number | percentage,
r: number | percentage = number(0), g: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (1, 2, 0))
- def brga(self, b: number | percentage,
- r: number | percentage = number(0), g: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (1, 2, 0))
-
+ @_Reference.alias('bgra')
def bgr(self, b: number | percentage,
g: number | percentage = number(0), r: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (2, 1, 0))
- def bgra(self, b: number | percentage,
- g: number | percentage = number(0), r: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (2, 1, 0))
-
+ @_Reference.alias('gbra')
def gbr(self, g: number | percentage,
b: number | percentage = number(0), r: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (2, 0, 1))
- def gbra(self, g: number | percentage,
- b: number | percentage = number(0), r: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (2, 0, 1))
-
+ @_Reference.alias('grba')
def grb(self, g: number | percentage,
r: number | percentage = number(0), b: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._rgb((r, g, b, alpha), (1, 0, 2))
- def grba(self, g: number | percentage,
- r: number | percentage = number(0), b: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._rgb((r, g, b, alpha), (1, 0, 2))
-
# ---
# HLS and HWB aliases.
# ---
+ @_Reference.alias('hlsa')
def hls(self, h: number | angle, l: number | percentage,
s: number | percentage, alpha: number | percentage = number(1.0)):
return self._hsl((h, s, l, alpha), (0, 2, 1))
- def hlsa(self, h: number | angle, l: number | percentage,
- s: number | percentage, alpha: number | percentage = number(1.0)):
- return self._hsl((h, s, l, alpha), (0, 2, 1))
-
+ @_Reference.alias('hbwa')
def hbw(self, h: number | angle, b: number | percentage = number(0),
w: number | percentage = number(0),
alpha: number | percentage = number(1.0)):
return self._hwb((h, w, b, alpha), (0, 2, 1))
- def hbwa(self, h: number | angle, b: number | percentage = number(0),
- w: number | percentage = number(0),
- alpha: number | percentage = number(1.0)):
- return self._hwb((h, w, b, alpha), (0, 2, 1))
-
# ---
# CMYK utilities and extensions.
# ---
@@ -252,7 +225,7 @@ class DefaultReference(_CSS4Reference):
def ncol(self, col: color) -> color:
# Compatibility with w3color.js! NCols are managed directly without
- # the function, so the functio doesn't do anything.
+ # the function, so the function doesn't do anything.
return col