class sap.ui.unified.ColorPickerPopover

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/unified/ColorPickerPopover
Application Component: CA-UI5-CTR

A thin wrapper over sap.ui.unified.ColorPicker allowing the latter to be used in a popover.


Constructor

Constructor for a new ColorPickerPopover.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.unified.ColorPickerPopover(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
colorString string

Determines the input parameter that can be a string of type HEX, RGB, HSV, or a CSS color name:

  • HEX - #FFFFFF
  • RGB - rgb(255,255,255)
  • HSV - hsv(360,100,100)
  • CSS - red
Note: The output parameter is an RGB string of the current color.

Since: 1.60.0.

Visibility: public
displayMode sap.ui.unified.ColorPickerDisplayMode Default

Determines the display mode of the ColorPicker among three types - Default, Large and Simplified

Since: 1.60.0.

Visibility: public
mode sap.ui.unified.ColorPickerMode HSV

Determines the color mode of the ColorPicker.

Since: 1.60.0.

Visibility: public

Events Overview

Event Description
change

Fired when the submit button of the popover is clicked.

Since: 1.60.0.

liveChange

Fired when the value is changed by user interaction in the internal ColorPicker

Since: 1.85.

change

Fired when the submit button of the popover is clicked.

Since: 1.60.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
r int

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).

liveChange

Fired when the value is changed by user interaction in the internal ColorPicker

Since: 1.85.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
r int

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).


Methods Overview

Method Description
attachChange

Attaches event handler fnFunction to the change event of this sap.ui.unified.ColorPickerPopover.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.ColorPickerPopover itself.

Fired when the submit button of the popover is clicked.

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.ui.unified.ColorPickerPopover.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.ColorPickerPopover itself.

Fired when the value is changed by user interaction in the internal ColorPicker

close

Closes the ColorPickerPopover.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.unified.ColorPickerPopover.

The passed function and listener object must match the ones used for event registration.

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.ui.unified.ColorPickerPopover.

The passed function and listener object must match the ones used for event registration.

sap.ui.unified.ColorPickerPopover.extend

Creates a new subclass of class sap.ui.unified.ColorPickerPopover with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

fireChange

Fires event change to attached listeners.

fireLiveChange

Fires event liveChange to attached listeners.

getColorString

Gets current value of property colorString.

Determines the input parameter that can be a string of type HEX, RGB, HSV, or a CSS color name:

  • HEX - #FFFFFF
  • RGB - rgb(255,255,255)
  • HSV - hsv(360,100,100)
  • CSS - red
Note: The output parameter is an RGB string of the current color.

getDisplayMode

Gets current value of property displayMode.

Determines the display mode of the ColorPicker among three types - Default, Large and Simplified

Default value is Default.

sap.ui.unified.ColorPickerPopover.getMetadata

Returns a metadata object for class sap.ui.unified.ColorPickerPopover.

getMode

Gets current value of property mode.

Determines the color mode of the ColorPicker.

Default value is HSV.

openBy

Opens the ColorPickerPopover. The popover is positioned relative to the control parameter on tablet or desktop and is full screen on phone. Therefore the openBy parameter is only used on tablet or desktop and is ignored on phone.

setColorString

Sets a new value for property colorString.

Determines the input parameter that can be a string of type HEX, RGB, HSV, or a CSS color name:

  • HEX - #FFFFFF
  • RGB - rgb(255,255,255)
  • HSV - hsv(360,100,100)
  • CSS - red
Note: The output parameter is an RGB string of the current color.

When called with a value of null or undefined, the default value of the property will be restored.

setDisplayMode

Sets a new value for property displayMode.

Determines the display mode of the ColorPicker among three types - Default, Large and Simplified

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Default.

setMode

Sets a new value for property mode.

Determines the color mode of the ColorPicker.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is HSV.

attachChange

Attaches event handler fnFunction to the change event of this sap.ui.unified.ColorPickerPopover.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.ColorPickerPopover itself.

Fired when the submit button of the popover is clicked.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.ColorPickerPopover itself

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.ui.unified.ColorPickerPopover.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.ColorPickerPopover itself.

Fired when the value is changed by user interaction in the internal ColorPicker

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.ColorPickerPopover itself

close

Closes the ColorPickerPopover.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.unified.ColorPickerPopover.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.ui.unified.ColorPickerPopover.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.unified.ColorPickerPopover.extend

Creates a new subclass of class sap.ui.unified.ColorPickerPopover with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireChange

Fires event change to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

r int

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).

fireLiveChange

Fires event liveChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

r int

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).

getColorString

Gets current value of property colorString.

Determines the input parameter that can be a string of type HEX, RGB, HSV, or a CSS color name:

Note: The output parameter is an RGB string of the current color.

getDisplayMode

Gets current value of property displayMode.

Determines the display mode of the ColorPicker among three types - Default, Large and Simplified

Default value is Default.

sap.ui.unified.ColorPickerPopover.getMetadata

Returns a metadata object for class sap.ui.unified.ColorPickerPopover.

getMode

Gets current value of property mode.

Determines the color mode of the ColorPicker.

Default value is HSV.

openBy

Opens the ColorPickerPopover. The popover is positioned relative to the control parameter on tablet or desktop and is full screen on phone. Therefore the openBy parameter is only used on tablet or desktop and is ignored on phone.

Param Type DefaultValue Description
openBy Object

When this control is displayed on tablet or desktop, the ColorPickerPopover is positioned relative to this control

setColorString

Sets a new value for property colorString.

Determines the input parameter that can be a string of type HEX, RGB, HSV, or a CSS color name:

Note: The output parameter is an RGB string of the current color.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sColorString string

New value for property colorString

setDisplayMode

Sets a new value for property displayMode.

Determines the display mode of the ColorPicker among three types - Default, Large and Simplified

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Default.

Param Type DefaultValue Description
sDisplayMode sap.ui.unified.ColorPickerDisplayMode Default

New value for property displayMode

setMode

Sets a new value for property mode.

Determines the color mode of the ColorPicker.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is HSV.

Param Type DefaultValue Description
sMode sap.ui.unified.ColorPickerMode HSV

New value for property mode