branch: externals/colorful-mode
commit 9d2d0aa3ec2263b879f4a9da6087c9f58da922d2
Author: Elías Gabriel Pérez <[email protected]>
Commit: Elías Gabriel Pérez <[email protected]>
Fix the decimals when specifying the alpha amount in the CSS functions
fixes: github #27
* colorful-mode.el (colorful-add-rgb-colors)
(colorful-add-oklab-oklch-colors, colorful-add-hsl-colors): Fix.
---
colorful-mode.el | 8 ++++----
test/css.css | 5 +++--
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/colorful-mode.el b/colorful-mode.el
index f4b88cbddf..4e68fd9b62 100644
--- a/colorful-mode.el
+++ b/colorful-mode.el
@@ -856,7 +856,7 @@ This is intended to be used with
`colorful-extra-color-keyword-functions'."
(opt (or "/" ",") (zero-or-more " ")
(or (seq (zero-or-one digit)
(opt ".")
- digit)
+ (one-or-more digit))
digit)
(opt (or "%" (zero-or-more " "))))
")"))
@@ -886,7 +886,7 @@ This is intended to be used with
`colorful-extra-color-keyword-functions'."
(opt (or "/" ",") (zero-or-more " ")
(group (or (seq (zero-or-one digit)
(opt ".")
- digit)
+ (one-or-more digit))
digit)
(opt (or "%" (zero-or-more " ")))))
")"))
@@ -909,7 +909,7 @@ This is intended to be used with
`colorful-extra-color-keyword-functions'."
(opt (or "/" ",") (zero-or-more " ")
(group (or (seq (zero-or-one digit)
(opt ".")
- digit)
+ (one-or-more digit))
digit)
(opt (or "%" (zero-or-more " ")))))
")"))
@@ -932,7 +932,7 @@ This is intended to be used with
`colorful-extra-color-keyword-functions'."
(opt (or "/" ",") (zero-or-more " ")
(or (seq (zero-or-one digit)
(opt ".")
- digit)
+ (one-or-more digit))
digit)
(opt (or "%" (zero-or-more " "))))
")"))
diff --git a/test/css.css b/test/css.css
index f2c7f67074..f246b74a70 100644
--- a/test/css.css
+++ b/test/css.css
@@ -8,7 +8,6 @@
--red-100: #FF4500;
--invalid-background-color: var(--red-100);
-
--function-color-1: oklch(89.32% 0.12 248.9); /* #b5e1ff */
--function-color-2: var(--function-color-1); /* #b5e1ff */
@@ -41,7 +40,7 @@ oklch(0.50 0.25 255.2); /* #0054EB */
/*****************************************************************************/
rgb(245, 224, 220) hsl(360, 47%, 63%)
-rgb(232,100,0) hsl(23deg, 55, 67+)
+rgb(232,100,0) hsl(23deg, 55%, 67%)
rgb(300,100,0) /* <-- These both shouldn't be highlighted. */
hsl(361, 47%, 63%) /* <-- */
@@ -55,6 +54,8 @@ rgb(100.52% 0.52 0.52)
rgb(232,100,0 / 0.5)
rgb(232,100,0 / 50%)
+rgb(100 205 243 / 0.25)
+
rgba(203, 166, 247, 0.3)
rgba(243,139,168,0.3)
rgba(250 , 179 , 135 , 0.3)