SBPaletteSequential#
This class is a base class for sequential color palettes.
A sequential palette is constructed in a 3D color coordinate space with coordinates named hue
, chroma
, and luminance
, that are computed as follows:
hue = hue1 + i * (hue2 - hue1)
if
Cmax < chroma1
ormaximumChroma < chroma2
thenchroma
is computed based on a “linear” trajectorychroma = chroma1 + i^(chromaPower) * (chroma2 - chroma1)
(see samson.SBPalette.getValueAlongLinearTrajectory), else it is computed based on the triangular trajectory (see samson.SBPalette.getValueAlongTriangularTrajectory)luminance = luminance1 + i^(luminancePower) * (luminance2 - luminance1)
Here i
is a value (of intensity) based on which the colorization should be done.
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.SBPaletteSequential(*args, **kwargs)#
Bases:
SBPalette
This class is a base class for sequential color palettes.
Overloaded function.
__init__(self: samson.SBPaletteSequential) -> None
Default constructor
__init__(self: samson.SBPaletteSequential, hue1: int, hue2: int, chroma1: int = 50, maximumChroma: int = 50, chroma2: int = 50, luminance1: int = 70, luminance2: int = 70, chromaPower: float = 1.0, luminancePower: float = 1.0, name: str = ‘’, reverse: bool = False) -> None
Constructs a sequential color palette with the given parameters.
- Parameters:
hue1 (int) – The left-side hue
hue2 (int) – The right-side hue
chroma1 (int, default=50) – The left-side chroma
maximumChroma (int, default=50) – The maximum chroma
chroma2 (int, default=50) – The right-side 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
name (str, default='') – A palette name
reverse (bool, default=False) – The reverse flag - whether the color palette is mirrored or not.
Examples
>>> palette = SBPaletteSequential(hue1 = 60, hue2 = 270, chroma1 = 60, maximumChroma = 60, chroma2 = 60, luminance1 = 80, luminance2 = 80)
__init__(self: samson.SBPaletteSequential, palette: samson.SBPaletteSequential) -> None
Constructs a sequential color palette based on the given sequential color palette.
- Parameters:
palette (samson.SBPaletteSequential) – Another sequential color palette
- setChroma(self: samson.SBPaletteSequential, chroma1: int, maximumChroma: int, chroma2: int, chromaPower: float = 1.0) None #
Sets chroma values.
- Parameters:
chroma1 (int) – The left-side chroma
maximumChroma (int) – The maximum chroma
chroma2 (int) – The right-side chroma
chromaPower (float, default=1.0) – The chroma power
- setHue(self: samson.SBPaletteSequential, hue1: int, hue2: int) None #
Sets hue values.
- Parameters:
hue1 (int) – The left-side hue
hue2 (int) – The right-side hue
- setLuminance(self: samson.SBPaletteSequential, 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 chroma2#
- property chromaPower#
- property hue1#
- property hue2#
- property luminance1#
- property luminance2#
- property luminancePower#
- property maximumChroma#