SBPaletteDivergingHCL#
This class is a base class for diverging HCL (Hue-Chroma-Luminance) 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 (samson.SBPaletteSequentialHCL).
In each arm, the luminance value changes from luminance1 to luminance2 as in the sequential palette (samson.SBPaletteSequentialHCL).
# Diverging: Blue-Red
palette = SBPaletteDivergingHCL(
hue1 = 260, hue2 = 0,
chroma1 = 80, maximumChroma = 80,
luminance1 = 30, luminance2 = 90,
chromaPower = 1.0,
luminancePower = 1.5,
neutralPoint = 0.5,
name = "Diverging: Blue-Red")
Note
You can find available default palettes in samson.SBPaletteDefaultPalette.
- class samson.SBPaletteDivergingHCL(*args, **kwargs)#
Bases:
SBPaletteDivergingThis class is a base class for the diverging HCL (Hue-Chroma-Luminance) color palette.
Overloaded function.
__init__(self: samson.SBPaletteDivergingHCL) -> None
Default constructor
__init__(self: samson.SBPaletteDivergingHCL, 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 HCL 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 = SBPaletteDivergingHCL(hue1 = 60, hue2 = 270, chroma1 = 60, maximumChroma = 60, luminance1 = 80, luminance2 = 80)
__init__(self: samson.SBPaletteDivergingHCL, palette: samson.SBPaletteDivergingHCL) -> None
Constructs a diverging color palette based on the given diverging HCL color palette.
- Parameters:
palette (samson.SBPaletteDivergingHCL) – Another diverging HCL color palette