SBPaletteDiverging#
This class is a base class for diverging color palettes.
A diverging palette is constructed in a 3D color coordinate space with coordinates named hue, chroma, and luminance.
The diverging palette can be represented as two sequential palettes: one to the left (left arm) and another one to the right (right arm) from the diverging point (neutral point, neutralPoint).
The value for hue is constant for both arms:
hue1for the left arm (the intensity value less or equal thanneutralPoint);hue2for the right arm (the intensity value greater thanneutralPoint).
In each arm, the chroma value changes from chroma1 to 0.0 through maximumChroma (if present and if maximumChroma > chroma1) in the same way as in the sequential palette.
In each arm, the luminance value changes from luminance1 to luminance2 as in the sequential palette.
Coordinate hue can designate e.g. hue (as in HCL, HSV, HSL color spaces).
Coordinate chroma can designate e.g. chroma (as in HCL color space) or saturation (as in HSV, HSL color spaces).
Coordinate luminance can designate e.g. luminance (as in HCL color space), lightning (as in HSL color space), or another value (as in HSV color space).
- class samson.SBPaletteDiverging(*args, **kwargs)#
Bases:
SBPaletteThis class is a base class for diverging color palettes.
Overloaded function.
__init__(self: samson.SBPaletteDiverging) -> None
Default constructor
__init__(self: samson.SBPaletteDiverging, hue1: int, hue2: int, chroma1: int = 50, maximumChroma: int = 50, luminance1: int = 70, luminance2: int = 70, chromaPower: float = 1.0, luminancePower: float = 1.0, neutralPoint: float = 0.5, name: str = ‘’, reverse: bool = False) -> None
Constructs a diverging color palette with the given parameters.
- Parameters:
hue1 (int) – The left-side hue
hue2 (int) – The right-side hue
chroma1 (int, default=50) – The chroma value
maximumChroma (int, default=50) – The maximum chroma
luminance1 (int, default=70) – The left-side luminance
luminance2 (int, default=70) – The right-side luminance
chromaPower (float, default=1.0) – The chroma power
luminancePower (float, default=1.0) – The luminance power
neutralPoint (float, default=0.5) – The neutral point
name (str, default='') – A palette name
reverse (bool, default=False) – The reverse flag - whether the color palette is mirrored or not.
Examples
>>> palette = SBPaletteDiverging(hue1 = 60, hue2 = 270, chroma1 = 60, maximumChroma = 60, luminance1 = 80, luminance2 = 80)
__init__(self: samson.SBPaletteDiverging, palette: samson.SBPaletteDiverging) -> None
Constructs a diverging color palette based on the given diverging color palette.
- Parameters:
palette (samson.SBPaletteDiverging) – Another diverging color palette
- setChroma(self: samson.SBPaletteDiverging, chroma1: int, maximumChroma: int, chromaPower: float = 1.0) None#
Sets chroma values.
- Parameters:
chroma1 (int) – The chroma value
maximumChroma (int) – The maximum chroma
chromaPower (float, default=1.0) – The chroma power
- setHue(self: samson.SBPaletteDiverging, hue1: int, hue2: int) None#
Sets hue values.
- Parameters:
hue1 (int) – The left-side hue
hue2 (int) – The right-side hue
- setLuminance(self: samson.SBPaletteDiverging, luminance1: int, luminance2: int, luminancePower: float = 1.0) None#
Sets luminance values.
- Parameters:
luminance1 (int) – The left-side luminance
luminance2 (int) – The right-side luminance
luminancePower (float, default=1.0) – The luminance power
- property chroma1#
- property chromaPower#
- property hue1#
- property hue2#
- property luminance1#
- property luminance2#
- property luminancePower#
- property maximumChroma#
- property neutralPoint#