ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Palette.UniformPalette Class Reference
Collaboration diagram for Palette.UniformPalette:

Public Member Functions

 __init__ (self, qerror_min, qerror_max, colors)
 
- Public Member Functions inherited from Palette.Palette
 colorscheme (self)
 

Protected Attributes

 _colors
 
 _slots
 
- Protected Attributes inherited from Palette.Palette
 _slots
 
 _colors
 

Detailed Description

Definition at line 43 of file Palette.py.

Constructor & Destructor Documentation

◆ __init__()

Palette.UniformPalette.__init__ (   self,
  qerror_min,
  qerror_max,
  colors 
)

Reimplemented from Palette.Palette.

Reimplemented in Palette.YLORRD9Palette.

Definition at line 44 of file Palette.py.

44 def __init__(self, qerror_min, qerror_max, colors):
45 self._colors = colors
46 self._slots = []
47 qerror_range = qerror_max - qerror_min
48 num_colors = len(self._colors)
49 for i in range(num_colors):
50 lower_bound = qerror_min + i * (qerror_range / num_colors)
51 upper_bound = qerror_min + (i + 1) * (qerror_range / num_colors)
52
53 self._slots.append([lower_bound, upper_bound])
54
55 # Invariant
56 assert len(self._slots) == num_colors
57
58
59# Palette for ylorrd9 colorscheme

Field Documentation

◆ _colors

Palette.UniformPalette._colors
protected

◆ _slots

Palette.UniformPalette._slots
protected

Definition at line 46 of file Palette.py.

Referenced by Palette.Palette.colorscheme().


The documentation for this class was generated from the following file: