get_random_colormap
[#392]get_n_shades_of
[#396]_isSequence
[#409]getColor
[#425]getColorName
[#510]hsv2rgb
[#529]rgb2hsv
[#539]rgb2int
[#549]colorMap
[#563]makePalette
[#629]get_random_colors
[#684]check_colors
[#701]
Check the source code
online
def get_random_colormap():
docstring:
no docstring
Check the source code
online
def get_n_shades_of(shade, n):
docstring:
:param shade: color
:param n: numnber of colors
Check the source code
online
def _isSequence(arg):
docstring:
:param arg: item to check
Check the source code
online
def getColor(rgb=None, hsv=None):
docstring:
Convert a color or list of colors to (r,g,b) format from many
different input formats.
:param bool: hsv: if set to `True`, rgb is assumed as (hue,
saturation, value).
Example:
- RGB= (255, 255, 255), corresponds to white
- rgb= (1,1,1) is white
- hex= #FFFF00 is yellow
- string = 'white'
- string = 'w' is white nickname
- string = 'dr' is darkred
- int= 7 picks color nr. 7 in a predefined color list
- int= -7 picks color nr. 7 in a different predefined list
|colorcubes| |colorcubes.py|_
:param rgb: (Default value = None)
:param hsv: (Default value = None)
Check the source code
online
def getColorName(c):
docstring:
Find the name of a color.
|colorpalette| |colorpalette.py|_
:param c: c
Check the source code
online
def hsv2rgb(hsv):
docstring:
Convert HSV to RGB color.
:param hsv: gsv
Check the source code
online
def rgb2hsv(rgb):
docstring:
Convert RGB to HSV color.
:param rgb: rgb
Check the source code
online
def rgb2int(rgb_tuple):
docstring:
:param rgb_tuple: rgb
Check the source code
online
def colorMap(value, name='jet', vmin=None, vmax=None):
docstring:
Map a real value in range [vmin, vmax] to a (r,g,b) color scale.
:param value: scalar value to transform into a color
:type value: float, list
:param name: color map name (Default value = "jet")
:type name: str, matplotlib.colors.LinearSegmentedColormap
:param vmin: (Default value = None)
:param vmax: (Default value = None)
:returns: return: (r,g,b) color, or a list of (r,g,b) colors.
.. note:: Most frequently used color maps:
|colormaps|
Matplotlib full list:
.. image:: https://matplotlib.org/1.2.1/_images/show_colormaps.png
.. tip:: Can also use directly a matplotlib color map:
:Example:
.. code-block:: python
from vedo import colorMap
import matplotlib.cm as cm
print( colorMap(0.2, cm.flag, 0, 1) )
(1.0, 0.809016994374948, 0.6173258487801733)
Check the source code
online
def makePalette(N, *colors):
docstring:
Generate N colors starting from `color1` to `color2`
by linear interpolation HSV in or RGB spaces.
Adapted from vedo makePalette function
:param int: N: number of output colors.
:param colors: input colors, any number of colors with 0 < ncolors <=
N is okay.
Check the source code
online
def get_random_colors(n_colors=1):
docstring:
:param n_colors: (Default value = 1)
Check the source code
online
def check_colors(color):
docstring:
:param color: color