import { InputElement } from "./InputElement" import { UIEventSource } from "../../Logic/UIEventSource" export default class ColorPicker extends InputElement { IsSelected: UIEventSource = new UIEventSource(false) private readonly value: UIEventSource private readonly _element: HTMLElement constructor(value: UIEventSource = new UIEventSource(undefined)) { super() this.value = value const el = document.createElement("input") this._element = el el.type = "color" this.value.addCallbackAndRunD((v) => { el.value = v }) el.oninput = () => { const hex = el.value value.setData(hex) } } GetValue(): UIEventSource { return this.value } IsValid(t: string): boolean { return false } protected InnerConstructElement(): HTMLElement { return this._element } }