ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Palette.Palette Class Reference

Public Member Functions

 __init__ (self)
 
 colorscheme (self)
 

Protected Attributes

 _slots
 
 _colors
 

Detailed Description

Definition at line 17 of file Palette.py.

Constructor & Destructor Documentation

◆ __init__()

Palette.Palette.__init__ (   self)

Reimplemented in Palette.YLORRD9Palette, and Palette.UniformPalette.

Definition at line 19 of file Palette.py.

19 def __init__(self):
20 # Element of self._slots has [lower bound, upper bound] of qerrors to decide a color
21 self._slots = []
22 # Element of self._colors has rgb values in string format
23 self._colors = []
24 raise NotImplementedError('Child class must implement __init__')
25

Member Function Documentation

◆ colorscheme()

Palette.Palette.colorscheme (   self)

Definition at line 31 of file Palette.py.

31 def colorscheme(self):
32 cs = []
33 for slot, color in zip(self._slots, self._colors):
34 cs.append({"b": slot[0], "e": slot[1], "c": color})
35 return cs
36
37
38# Ranges of slots are defined by qerror_min/qerror_max
39# Each slot has a uniform range
40# For example, if qerror_min = 0.0, qerror_max = 1.0, number of colors = 10
41# Ranges of slots will be as follows.
42# [0.0, 0.1], [0.1, 0.2], [0.2, 0.3] ... [0.8, 0.9], [0.9, 1.0]

References DotBuilder.DotBuilder._colors, Palette.Palette._colors, Palette.UniformPalette._colors, Palette.Palette._slots, and Palette.UniformPalette._slots.

Field Documentation

◆ _colors

Palette.Palette._colors
protected

◆ _slots

Palette.Palette._slots
protected

Definition at line 21 of file Palette.py.

Referenced by Palette.Palette.colorscheme().


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