SBColorSchemeConstant#

This class describes a constant color scheme.

Please refer to samson.SBNodeColorScheme.

See also

SAMSON SDK: SBDColorSchemeConstant

class samson.SBColorSchemeConstant(*args, **kwargs)#

Bases: SBNodeColorScheme

This class describes a constant color scheme.

Overloaded function.

  1. __init__(self: samson.SBColorSchemeConstant) -> None

Constructs a constant color scheme with the white color (1.0, 1.0, 1.0, 1.0).

Examples

>>> constantColorScheme = SBColorSchemeConstant()
>>> color = constantColorScheme.getColor()
>>> print(color)
[1.000000, 1.000000, 1.000000, 1.000000]
  1. __init__(self: samson.SBColorSchemeConstant, red: float, green: float, blue: float, alpha: float = 1.0) -> None

Constructs a constant color scheme with the given color (red, green, blue, alpha). Arguments should be in the range [0.0, 1.0].

Parameters:
  • red (float) – The red component of RGB-color.

  • green (float) – The green component of RGB-color.

  • blue (float) – The blue component of RGB-color.

  • alpha (float, default=1.0) – The alpha component (transparency).

Examples

>>> constantColorScheme = SBColorSchemeConstant(0.25, 0.5, 0.75, 1.0)
>>> color = constantColorScheme.getColor()
>>> print(color)
[0.250000, 0.500000, 0.750000, 1.000000]
  1. __init__(self: samson.SBColorSchemeConstant, red: int, green: int, blue: int, alpha: int = 255) -> None

Constructs a constant color scheme with the given color (red, green, blue, alpha). Arguments should be in the range [0, 255].

Parameters:
  • red (int) – The red component of RGB-color.

  • green (int) – The green component of RGB-color.

  • blue (int) – The blue component of RGB-color.

  • alpha (int, default=255) – The alpha component (transparency).

Examples

>>> constantColorScheme = SBColorSchemeConstant(120, 160, 200, 255)
>>> color = constantColorScheme.getColor()
>>> print(color)
[0.470588, 0.627451, 0.784314, 1.000000]
  1. __init__(self: samson.SBColorSchemeConstant, color: samson.SBColor) -> None

Constructs a constant color scheme with the given color.

Parameters:

color (samson.SBColor) – A color