[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
New function css-color (accompanying x11-color) (issue 570690043 by addr
From: |
thomasmorley65 |
Subject: |
New function css-color (accompanying x11-color) (issue 570690043 by address@hidden) |
Date: |
Mon, 03 Jun 2019 15:13:53 -0700 |
https://codereview.appspot.com/570690043/diff/564820043/scm/color.scm
File scm/color.scm (right):
https://codereview.appspot.com/570690043/diff/564820043/scm/color.scm#newcode678
scm/color.scm:678: (define css-color-list
Is there anything new in this list or are all entries always alias?
If the latter, why spelling it out? Instead one could do:
(map
(lambda (elt)
(cons
(string->symbol (string-downcase (symbol->string (car elt))))
(cdr elt)))
x11-color-list)
Or even join them with
(append <above> x11-color-list)
Probably sorting it and deleting duplicates.
Would save one argument in make-color-handler below.
The other argument could be thrown out, if you first try to get a color
with the user-input, then with a downcased user-input and if all that is
not successful fallback to black with warning.
Ofcourse this leads to identical definitions for css-color and x11-color
and x11-color would return a color even for p.e. Darkblue (wrongly
cased).
I can't imagine a problem, though
https://codereview.appspot.com/570690043/
- New function css-color (accompanying x11-color) (issue 570690043 by address@hidden),
thomasmorley65 <=