aboutsummaryrefslogtreecommitdiff
path: root/thcolor/builtin.py
diff options
context:
space:
mode:
Diffstat (limited to 'thcolor/builtin.py')
-rw-r--r--thcolor/builtin.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/thcolor/builtin.py b/thcolor/builtin.py
index 077cf09..5cf1646 100644
--- a/thcolor/builtin.py
+++ b/thcolor/builtin.py
@@ -63,9 +63,9 @@ class CSS1ColorDecoder(_MetaColorDecoder):
""" Make an RGB color out of the given components. """
return _SRGBColor(
- red=red / 255,
- green=green / 255,
- blue=blue / 255,
+ red=_factor(red, max_=255, clip=True),
+ green=_factor(green, max_=255, clip=True),
+ blue=_factor(blue, max_=255, clip=True),
alpha=1.0,
)
@@ -225,10 +225,10 @@ class CSS3ColorDecoder(CSS2ColorDecoder):
""" Make an RGB color out of the given components. """
return _SRGBColor(
- red=_factor(red, max_=255),
- green=_factor(green, max_=255),
- blue=_factor(blue, max_=255),
- alpha=_factor(alpha),
+ red=_factor(red, max_=255, clip=True),
+ green=_factor(green, max_=255, clip=True),
+ blue=_factor(blue, max_=255, clip=True),
+ alpha=_factor(alpha, clip=True),
)
def hsl(
@@ -256,6 +256,8 @@ class CSS4ColorDecoder(CSS3ColorDecoder):
See <https://drafts.csswg.org/css-color/>_ for more information..
"""
+ __extended_hex_support__ = True
+
rebeccapurple = _rgb('#663399')
def hwb(