import type { ColorModel , ColorPickerEventListener , ColorPickerEventMap } from '../types' ; import { ColorPicker } from '../components/color-picker.js' ; import { rgbStringToHsva , hsvaToRgbString } from '../utils/convert.js' ; import { equalColorString } from '../utils/compare.js' ; const colorModel = { defaultColor : 'rgb(0, 0, 0)' , toHsva : rgbStringToHsva , fromHsva : hsvaToRgbString , equal : equalColorString , fromAttr : ( color ) => color } ; export interface RgbStringBase { addEventListener < T extends keyof ColorPickerEventMap < string > > ( type , listener , options ? ) : void ; removeEventListener < T extends keyof ColorPickerEventMap < string > > ( type , listener , options ? ) : void ; } export class RgbStringBase extends ColorPicker < string > { protected get colorModel ( ) : ColorModel < string > { return colorModel ; } }