SBPaletteFlexibleDivergingHCL#

This class is a base class for flexible diverging HCL (Hue-Chroma-Luminance) color palette

A flexible diverging palette is constructed in a 3D color coordinate space with coordinates named hue, chroma, and luminance.

Flexible diverging HCL color palettes is generated through a combination of two fully flexible multi-hue sequential palettes (samson.SBPaletteSequentialHCL).

Examples of flexible diverging HCL palettes#
# Flexible diverging: Earth
palette1 = SBPaletteFlexibleDivergingHCL(
  hue1 = 43, hue2 = 82, hue3 = 221,
  chroma1 = 61, chroma2 = 30, chroma3 = 45,
  luminance1 = 50, luminance2 = 92, luminance3 = 52,
  chromaPower1 = 1.0, luminancePower1 = 1.0,
  chromaPower2 = 0.8, luminancePower2 = 1.0,
  maximumChroma1 =  50, maximumChroma2 = 10,
  neutralPoint = 0.5,
  name = "Flexible diverging: Earth")

# Flexible diverging: Zissou 1
palette2 = SBPaletteFlexibleDivergingHCL(
  hue1 = 218, hue2 = 71, hue3 = 12,
  chroma1 = 46, chroma2 = 88, chroma3 = 165,
  luminance1 = 59, luminance2 = 82, luminance3 = 52,
  chromaPower1 = 0.2, luminancePower1 = 1.0,
  chromaPower2 = 3.0, luminancePower2 = 1.0,
  maximumChroma1 = 33, maximumChroma2 = 33,
  neutralPoint = 0.5,
  name = "Flexible diverging: Zissou 1")

# Flexible diverging: Cividis
palette3 = SBPaletteFlexibleDivergingHCL(
  hue1 = 255, hue2 = 1000, hue3 = 75,
  chroma1 = 30, chroma2 = 0, chroma3 = 95,
  luminance1 = 13, luminance2 = 52, luminance3 = 92,
  chromaPower1 = 1.1, luminancePower1 = 1.0,
  chromaPower2 = 1.0, luminancePower2 = 1.0,
  maximumChroma1 = 47, maximumChroma2 = 47,
  neutralPoint = 0.5,
  name = "Flexible diverging: Cividis")

Note

You can find available default palettes in samson.SBPaletteDefaultPalette.

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

Bases: SBPalette

This class is a class for the flexible diverging HCL (Hue-Chroma-Luminance) color palette.

Overloaded function.

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

Default constructor

  1. __init__(self: samson.SBPaletteFlexibleDivergingHCL, hue1: int, hue2: int, hue3: int, chroma1: int, chroma2: int, chroma3: int, luminance1: int = 70, luminance2: int = 70, luminance3: int = 70, chromaPower1: float = 1.0, luminancePower1: float = 1.0, chromaPower2: float = 1.0, luminancePower2: float = 1.0, maximumChroma1: int = 50, maximumChroma2: int = 50, neutralPoint: float = 0.5, name: str = ‘’, reverse: bool = False) -> None

Constructs a flexible diverging HCL color palette with the given parameters.

Parameters:
  • hue1 (int) – The left-side hue

  • hue2 (int) – The central hue

  • hue3 (int) – The right-side hue

  • chroma1 (int) – The left-side chroma

  • chroma2 (int) – The central chroma

  • chroma3 (int) – The right-side chroma

  • luminance1 (int, default=70) – The left-side luminance

  • luminance2 (int, default=70) – The central luminance

  • luminance3 (int, default=70) – The right-side luminance

  • chromaPower1 (float, default=1.0) – The chroma power of the left-side

  • chromaPower2 (float, default=1.0) – The chroma power of the right-side

  • luminancePower1 (float, default=1.0) – The luminance power of the left-side

  • luminancePower2 (float, default=1.0) – The luminance power of the right-side

  • maximumChroma1 (int, default=50) – The maximum chroma of the left-side

  • maximumChroma2 (int, default=50) – The maximum chroma of the right-side

  • 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 = SBPaletteFlexibleDivergingHCL(hue1 = 260, hue2 = 0, hue3 = 180, chroma1 = 40, chroma2 = 50, chroma3 = 40)
  1. __init__(self: samson.SBPaletteFlexibleDivergingHCL, palette: samson.SBPaletteFlexibleDivergingHCL) -> None

Constructs a flexible diverging color palette based on the given flexible diverging HCL color palette.

Parameters:

palette (samson.SBPaletteFlexibleDivergingHCL) – Another flexible diverging HCL color palette

setChroma(self: samson.SBPaletteFlexibleDivergingHCL, chroma1: int, chroma2: int, chroma3: int, maximumChroma1: int, maximumChroma2: int, chromaPower1: float = 1.0, chromaPower2: float = 1.0) None#

Sets chroma values.

Parameters:
  • chroma1 (int) – The left-side chroma

  • chroma2 (int) – The central chroma

  • chroma3 (int) – The right-side chroma

  • maximumChroma1 (int) – The maximum chroma of the left-side

  • maximumChroma2 (int) – The maximum chroma of the right-side

  • chromaPower1 (float, default=1.0) – The chroma power of the left-side

  • chromaPower2 (float, default=1.0) – The chroma power of the right-side

setHue(self: samson.SBPaletteFlexibleDivergingHCL, hue1: int, hue2: int, hue3: int) None#

Sets hue values.

Parameters:
  • hue1 (int) – The left-side hue

  • hue2 (int) – The central hue

  • hue3 (int) – The right-side hue

setLuminance(self: samson.SBPaletteFlexibleDivergingHCL, luminance1: int, luminance2: int, luminance3: int, luminancePower1: float = 1.0, luminancePower2: float = 1.0) None#

Sets luminance values.

Parameters:
  • luminance1 (int) – The left-side luminance

  • luminance2 (int) – The central luminance

  • luminance3 (int) – The right-side luminance

  • luminancePower1 (float, default=1.0) – The luminance power of the left-side

  • luminancePower2 (float, default=1.0) – The luminance power of the right-side

property chroma1#
property chroma2#
property chroma3#
property chromaPower1#
property chromaPower2#
property hue1#
property hue2#
property hue3#
property luminance1#
property luminance2#
property luminance3#
property luminancePower1#
property luminancePower2#
property maximumChroma1#
property maximumChroma2#
property neutralPoint#