Commit 5a4449b
committed
Add support for html named colors
Quill deltas often contain named colors from the standard HTML color palette. This is especially true if the delta was created using Quill on web.
These named colors could not be handled by flutter_quill, and so an exception was thrown.
This change adds dart contants for the 140 named html colors. It modifies `stringToColor` to check if the input is one of the named colors, and returns the value if found. Web colors are case insensitive.1 parent e14689b commit 5a4449b
File tree
4 files changed
+477
-2
lines changed- lib/src/common/utils
- test/common/utils
4 files changed
+477
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | | - | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
0 commit comments