| 141 | } |
| 142 | |
| 143 | toDOM(): HTMLElement { |
| 144 | const wrapper = document.createElement("span"); |
| 145 | wrapper.className = "cm-color-chip"; |
| 146 | wrapper.style.display = "inline-block"; |
| 147 | wrapper.style.width = "0.9em"; |
| 148 | wrapper.style.height = "0.9em"; |
| 149 | wrapper.style.borderRadius = "2px"; |
| 150 | wrapper.style.verticalAlign = "middle"; |
| 151 | wrapper.style.margin = "0 2px"; |
| 152 | wrapper.style.boxSizing = "border-box"; |
| 153 | wrapper.style.border = "1px solid rgba(0,0,0,0.2)"; |
| 154 | wrapper.style.backgroundColor = this.colorRaw; |
| 155 | wrapper.dataset["color"] = this.color; |
| 156 | wrapper.dataset["colorraw"] = this.colorRaw; |
| 157 | wrapper.style.cursor = "pointer"; |
| 158 | colorState.set(wrapper, this.state); |
| 159 | return wrapper; |
| 160 | } |
| 161 | |
| 162 | ignoreEvent(): boolean { |
| 163 | return false; |