slitflow.fun.palette module

class Loop(items)[source]

Bases: object

Super class for loop generators.

set_items(items)[source]
class NumberLoop(items)[source]

Bases: Loop

Integer of float loop generator for matplotlib figure.

Parameters:

numbers (int or float or list) – Numbers for style loop.

Yields:

int or float – The next number in the range of numbers

set_items(items)[source]
class ColorLoop(items)[source]

Bases: Loop

RGB color generator for matplotlib figure.

Parameters:

colors (str or list) –

Name for edge or face color list. If list of int, this always returns a list which is it divided by 255.

If list of list of int, this returns a list which is a element of it divided by 255 in order.

If list of str, this returns a list which is a element of a palette registered in this class divided by 255 in order.

TODO: Future plan (If list of (palette, list of int), where type(palette) belong to above three, this creates a new palette by patch-working palettes in the list, and returns a list according to the palette. e.g, [([0,0,0], [1,2]), ([[1,1,1], [2,2,2]], 4)] let create a new palette [[1,1,1], [0,0,0], [0,0,0], [2,2,2]].)

Yields:

list of float – The next RGB values. RGB values should be [R(0-1), G(0-1), B(0-1)]

palette = {'scatter_face': ((211, 13, 13), (1, 1, 203), (41, 161, 154), (145, 81, 201), (167, 140, 73)), 'small_pastel_edge': ((50, 170, 160), (220, 170, 0), (122, 12, 112)), 'small_pastel_face': ((115, 195, 185), (252, 216, 0), (199, 111, 171)), 'umap_face': ((200, 200, 200), (150, 0, 150), (0, 150, 0)), 'umap_inv_face': ((200, 200, 200), (0, 150, 0), (150, 0, 150))}
set_items(items)[source]
class LineStyleLoop(items)[source]

Bases: Loop

Line style string generator for matplotlib figure.

Parameters:

styles (str or list) – Style string for line style.

Yields:

str – The next style string

style_dict = {'densely dashdotdotted': (0, (3, 1, 1, 1, 1, 1)), 'densely dashdotted': (0, (3, 1, 1, 1)), 'densely dashed': (0, (5, 1)), 'densely dotted': (0, (1, 1))}
palette = {'default': ['solid', (0, (5, 1)), (0, (1, 1)), (0, (3, 1, 1, 1)), (0, (3, 1, 1, 1, 1, 1))], 'with_model3': ['solid', (0, (5, 1)), (0, (1, 1)), 'None', 'None', 'None']}
set_items(items)[source]
class MarkerStyleLoop(items)[source]

Bases: Loop

Marker style string generator for matplotlib figure.

Parameters:

styles (str or list) – Style string for marker style.

Yields:

str – The next marker style string

palette = {'default': ['o', 's', '^', 'x', 'v'], 'with_model3': ['None', 'None', 'None', 'o', 's', '^']}
set_items(items)[source]