aboutsummaryrefslogtreecommitdiff
path: root/thcolor/_builtin/_css.py
diff options
context:
space:
mode:
Diffstat (limited to 'thcolor/_builtin/_css.py')
-rwxr-xr-xthcolor/_builtin/_css.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/thcolor/_builtin/_css.py b/thcolor/_builtin/_css.py
index 06bf539..6b49ff9 100755
--- a/thcolor/_builtin/_css.py
+++ b/thcolor/_builtin/_css.py
@@ -13,8 +13,12 @@ from .._exc import InvalidArgumentValueError as _InvalidArgumentValueError
__all__ = ["CSS1Reference", "CSS2Reference", "CSS3Reference",
"CSS4Reference"]
-def _rgb(hex):
- return _Color.from_text(hex, _Reference())
+def _rgb(raw):
+ r = int(raw[1:3], 16)
+ g = int(raw[3:5], 16)
+ b = int(raw[5:7], 16)
+
+ return _Color(_Color.Type.RGB, r, g, b)
class CSS1Reference(_Reference):
""" Named colors from CSS Level 1: