Color¶

class samson.DataModel.Color.Color(*args, **kwargs)¶

Bases: pybind11_builtins.pybind11_object

This class describes a color.

SAMSON API: SBDColor

Overloaded function.

  1. __init__(self: samson.DataModel.Color.Color) -> None

Constructs a color (1.0, 1.0, 1.0, 1.0)

  1. __init__(self: samson.DataModel.Color.Color, red: float, green: float, blue: float, alpha: float=1.0) -> None

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

Args:

red (float): red component of RGB-color

green (float): green component of RGB-color

blue (float): blue component of RGB-color

alpha (float): alpha component (transparency)

  1. __init__(self: samson.DataModel.Color.Color, red: int, green: int, blue: int, alpha: int=255) -> None

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

Args:

red (int): red component of RGB-color

green (int): green component of RGB-color

blue (int): blue component of RGB-color

alpha (int): alpha component (transparency)

  1. __init__(self: samson.DataModel.Color.Color, c: samson.DataModel.Color.Color) -> None

Constructs a color based on another color c.

fromHSV(hue: float, saturation: float, value: float) → samson.DataModel.Color.Color¶

Converts HSV into Color

getColor(self: samson.DataModel.Color.Color) → List[float]¶

Stores the four components as a float array

alpha¶

alpha component

black = [0.000000, 0.000000, 0.000000, 1.000000]¶
blue = [0.000000, 0.000000, 1.000000, 1.000000]¶
cyan = [0.000000, 1.000000, 1.000000, 1.000000]¶
green = [0.000000, 1.000000, 0.000000, 1.000000]¶
isSerializable¶

Returns true when the class is serializable

magenta = [1.000000, 0.000000, 1.000000, 1.000000]¶
red = [1.000000, 0.000000, 0.000000, 1.000000]¶
white = [1.000000, 1.000000, 1.000000, 1.000000]¶
yellow = [1.000000, 1.000000, 0.000000, 1.000000]¶