windkit.plot.color.Color
- class windkit.plot.color.Color(levels=None, colors=None)[source]
Class to create and store color dictionnaries and maps.
- Parameters:
levels (list of float, optional. Default: None) – List of values marking different color bins, both min and max level should be included. If levels is None, a default list of 15 levels from 0 to 1, plus a level of 100 is included.
colors (list of colors (rgb-tuple or html-str), optional. Default: None) – If tuple, should have 3 values, if string should have leading ‘#’. List should be one less than the number of levels. If None, a default list of 15 colors that represent the levels as roughness lengths is provided.
Methods
__init__
([levels, colors])add_color
(lower_level, color)Add a color to the set.
get_color_list
([html, index])Return a formatted list of colors.
match_colors_with_roughness
(z0[, html, ...])Return the list of colors corresponding to the list of roughness values.
update
(levels, colors)Update the ranges and colors of the object.