Color (hwx.inspire.Attributes)#

class Color(default=(0, 0, 0), **kwds)#

Bases: Triple

Stores a color value as 3 RGB float values between 0 to 1

The color can also be set by name like:

obj.color = “blue”

Attribute Table#

Name

Type

components

NoneType

Method Table#

Name

Description

castForSet (self, obj, value)

Converts and validates the value of the attribute before setting.

getGuiValue (self, obj)

populateGuiValue (self, obj, prop)

Override to customize, prop.value, displayValue, allowedValues.

castForSet(obj, value)#

Converts and validates the value of the attribute before setting.

Converts the value it to its internal type (and base units if applicable).

Parameters:
  • obj (GeneralObject) – Object this attribute belongs to.

  • value (Any) – Value of the attribute to set.

Returns:

Validated and converted value.

Return type:

value (Any)

getGuiValue(obj)#

Returns the formatted value, as shown in the Property Editor.

populateGuiValue(obj, prop)#

Override to customize, prop.value, displayValue, allowedValues.

The prop.value type determines which editor widget used: - bool -> checkbox - str -> line edit - hwtypes.Color -> color picker

Setting prop.allowedValues yields a ComboBox.

prop.displayValue is a str shown when the editor loses focus.

Value#

alias of Value