Backend\FormWidgets\ColorPicker

Overview

ColorPicker renders a color picker field.

Extends

Public Properties

public array $availableColors

availableColors by default

public bool $allowEmpty

allowEmpty value

public bool $allowCustom

allowCustom value

public bool $showAlpha

showAlpha opacity slider

public bool|null $showInput

showInput displays an input and disables the available colors.

public bool $readOnly

readOnly if true, the color picker is set to read-only mode

public bool $disabled

disabled if true, the color picker is set to disabled mode

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public getSaveValue()

public getSaveValue($value): void

getSaveValue processes the postback value for this widget. If the value is omitted from postback data, the form widget will be skipped.

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public prepareVars()

public prepareVars(): void

prepareVars for display

public render()

public render(): void

render the widget's primary contents.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getAvailableColors()

protected getAvailableColors(): array 

getAvailableColors as a list of available colors.

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

protected parseAsHex()

protected parseAsHex($value): void

parseAsHex ensures saved value is a valid hex color

Show inherited protected methods

Inherited Protected Methods