mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
lib/parsecolor: add "none" and "transparent"
This commit is contained in:
1 parent
30ac5c2e89
commit
40cf8c0ad1
3 files changed
+13
-2
No files matched your search
@@ -50,7 +50,10 @@ func Parse(s string) (nrgba color.NRGBA, ok bool) {
|
||||
|
||||
if !startsWithHash {
|
||||
adjustment, p, n := 0, 0, len(s)
|
||||
if string(buf[:4]) == "dark" {
|
||||
if ((n == 4) && (string(buf[:4]) == "none")) ||
|
||||
((n == 11) && (string(buf[:11]) == "transparent")) {
|
||||
return color.NRGBA{}, true
|
||||
} else if string(buf[:4]) == "dark" {
|
||||
adjustment = 1
|
||||
p += 4
|
||||
n -= 4
|
||||
|
||||
Reference in new issue
Block a user