import type { ColorPickerButton } from "./ColorPickerButton"; import type { ISpritePointerEvent } from "../../core/render/Sprite"; import { Color } from "../../core/util/Color"; import { ListTemplate } from "../../core/util/List"; import { Button } from "../../core/render/Button"; import { Circle } from "../../core/render/Circle"; import { Container, IContainerEvents, IContainerPrivate, IContainerSettings } from "../../core/render/Container"; import { EditableLabel } from "../../core/render/EditableLabel"; import { Rectangle } from "../../core/render/Rectangle"; import { RoundedRectangle } from "../../core/render/RoundedRectangle"; import { Slider } from "../../core/render/Slider"; export interface IColorPickerSettings extends IContainerSettings { /** * The [[ColorPickerButton]] whose color the picker edits. Setting it opens * the picker with the button's color, and changes show on the button at * once; `undefined` closes the picker. */ colorButton?: ColorPickerButton; /** * Hue of the selected color, `0` to `1`; the hue slider sets it. */ hue?: number; /** * The selected color. */ color?: Color; /** * Opacity of the selected color, `0` to `1`. */ colorOpacity?: number; /** * Color of what the picker sits on, white if not set. It outlines the * color square and shows through the opacity slider's grip. */ backgroundColor?: Color; } export interface IColorPickerPrivate extends IContainerPrivate { } export interface IColorPickerEvents extends IContainerEvents { /** * The user confirmed a color with the OK button, or removed it with the * no-color button. */ colorchanged: { color?: Color; colorOpacity?: number; }; } /** * A color picker with a color square, a hue slider, an eyedropper, a hex * input and an opacity slider. It opens for the [[ColorPickerButton]] set * as its `colorButton`. */ export declare class ColorPicker extends Container { static className: string; static classNames: Array; _settings: IColorPickerSettings; _privateSettings: IColorPickerPrivate; _events: IColorPickerEvents; protected _currentRectangle: RoundedRectangle | undefined; _clickOverlay: Rectangle; readonly rectangles: ListTemplate; /** * Container with the color square and the hue slider. */ gradientsContainer: Container; /** * Container for color gradients. * @ignore */ colorGradientsContainer: Container; /** * Rectangle that displays the color gradient. * @ignore */ colorRectangle: Rectangle; /** * Rectangle that displays the white overlay. * @ignore */ colorRectangleWhiteOverlay: Rectangle; /** * Rectangle that displays the black overlay. * @ignore */ colorRectangleBlackOverlay: Rectangle; /** * Vertical slider that sets the hue. */ slider: Slider; /** * @ignore */ inputContainer: Container; /** * Toggle button for the eyedropper: while it is on, the color follows the * chart pixel under the pointer, and a click keeps it. */ pickerButton: Button; /** * Button that removes the color and closes the picker. */ noColorButton: Button; /** * Editable label that shows the color in hex and takes a typed one. */ colorInput: EditableLabel; /** * @ignore */ opacityContainer: Container; /** * Slider that sets the color's opacity. Hidden when the `colorButton` has * `disableOpacity`. */ opacitySlider: Slider; /** * Circle that marks the selected color on the color square. */ targetCircle: Circle; /** * @ignore */ buttonsContainer: Container; /** * Button that restores the previous color and closes the picker. */ cancelButton: Button; /** * Button that confirms the color, dispatching `colorchanged`, and closes * the picker. */ okButton: Button; protected _isColorDown: boolean; protected _isPicking: boolean; protected _isEditing: boolean; protected _pickSnapshot: HTMLCanvasElement | undefined; protected _previousColor: Color | undefined; protected _previousOpacity: number | undefined; protected _prevColor: Color | undefined; /** * @ignore */ protected _afterNew(): void; /** * @ignore */ _updateChildren(): void; /** * @ignore */ protected _handleDirtyHue(): void; /** * @ignore */ protected _handleTargetMove(e: ISpritePointerEvent): void; /** * @ignore */ protected _updateColor(): void; /** * @ignore */ protected _updateOpacitySliderGrip(): void; /** * Restores the color the button had when the picker opened, and closes * the picker. */ cancel(): void; } //# sourceMappingURL=ColorPicker.d.ts.map