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 color value before setting.

getGuiValue (self, obj)

populateGuiValue (self, obj, prop)

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

castForSet(obj, value)#

Converts and validates the color value before setting.

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

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

Returns:

Validated and converted value.

Return type:

math.Vector

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.

class Value(r, g=None, b=None, obj=None, attr=None)#

Bases: object

Internal class to let the user specify the colors by name as well as rgb

Attribute Table#

Name

Type

guiLabel

property

guiValue

property

name

property