(value: string)
| 69 | } |
| 70 | |
| 71 | function strToColor (value: string): Color { |
| 72 | if (!value) { |
| 73 | return new Color(0, 0, 0, 255); |
| 74 | } |
| 75 | value = (value.indexOf('#') !== -1) ? value.substring(1) : value; |
| 76 | if (value.length === 8) { |
| 77 | const a = parseInt(value.substr(0, 2), 16) || 255; |
| 78 | const r = parseInt(value.substr(2, 2), 16) || 0; |
| 79 | const g = parseInt(value.substr(4, 2), 16) || 0; |
| 80 | const b = parseInt(value.substr(6, 2), 16) || 0; |
| 81 | return new Color(r, g, b, a); |
| 82 | } else { |
| 83 | const r = parseInt(value.substr(0, 2), 16) || 0; |
| 84 | const g = parseInt(value.substr(2, 2), 16) || 0; |
| 85 | const b = parseInt(value.substr(4, 2), 16) || 0; |
| 86 | return new Color(r, g, b, 255); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | function getPropertyList (node: Element, map?: PropertiesInfo): PropertiesInfo { |
| 91 | const res: any[] = []; |
no test coverage detected