colors

Contents

get_random_colormap [#392]

Check the source code online
1
def get_random_colormap():
Copied!
  docstring:
no docstring

get_n_shades_of [#396]

Check the source code online
1
def get_n_shades_of(shade, n):
Copied!
  docstring:
1
:param shade: color
2
3
:param n: numnber of colors
Copied!

_isSequence [#409]

Check the source code online
1
def _isSequence(arg):
Copied!
  docstring:
1
:param arg: item to check
Copied!

getColor [#425]

Check the source code online
1
def getColor(rgb=None, hsv=None):
Copied!
  docstring:
1
Convert a color or list of colors to (r,g,b) format from many
2
different input formats.
3
4
:param bool: hsv: if set to `True`, rgb is assumed as (hue,
5
saturation, value).
6
7
Example:
8
9
- RGB= (255, 255, 255), corresponds to white
10
11
- rgb= (1,1,1) is white
12
13
- hex= #FFFF00 is yellow
14
15
- string = 'white'
16
17
- string = 'w' is white nickname
18
19
- string = 'dr' is darkred
20
21
- int= 7 picks color nr. 7 in a predefined color list
22
23
- int= -7 picks color nr. 7 in a different predefined list
24
25
|colorcubes| |colorcubes.py|_
26
27
:param rgb: (Default value = None)
28
29
:param hsv: (Default value = None)
Copied!

getColorName [#510]

Check the source code online
1
def getColorName(c):
Copied!
  docstring:
1
Find the name of a color.
2
3
|colorpalette| |colorpalette.py|_
4
5
:param c: c
Copied!

hsv2rgb [#529]

Check the source code online
1
def hsv2rgb(hsv):
Copied!
  docstring:
1
Convert HSV to RGB color.
2
3
:param hsv: gsv
Copied!

rgb2hsv [#539]

Check the source code online
1
def rgb2hsv(rgb):
Copied!
  docstring:
1
Convert RGB to HSV color.
2
3
:param rgb: rgb
Copied!

rgb2int [#549]

Check the source code online
1
def rgb2int(rgb_tuple):
Copied!
  docstring:
1
:param rgb_tuple: rgb
Copied!

colorMap [#563]

Check the source code online
1
def colorMap(value, name='jet', vmin=None, vmax=None):
Copied!
  docstring:
1
Map a real value in range [vmin, vmax] to a (r,g,b) color scale.
2
3
:param value: scalar value to transform into a color
4
5
:type value: float, list
6
7
:param name: color map name (Default value = "jet")
8
9
:type name: str, matplotlib.colors.LinearSegmentedColormap
10
11
:param vmin: (Default value = None)
12
13
:param vmax: (Default value = None)
14
15
:returns: return: (r,g,b) color, or a list of (r,g,b) colors.
16
17
.. note:: Most frequently used color maps:
18
19
|colormaps|
20
21
Matplotlib full list:
22
23
.. image:: https://matplotlib.org/1.2.1/_images/show_colormaps.png
24
25
.. tip:: Can also use directly a matplotlib color map:
26
27
:Example:
28
29
.. code-block:: python
30
31
from vedo import colorMap
32
33
import matplotlib.cm as cm
34
35
print( colorMap(0.2, cm.flag, 0, 1) )
36
37
(1.0, 0.809016994374948, 0.6173258487801733)
Copied!

makePalette [#629]

Check the source code online
1
def makePalette(N, *colors):
Copied!
  docstring:
1
Generate N colors starting from `color1` to `color2`
2
3
by linear interpolation HSV in or RGB spaces.
4
5
Adapted from vedo makePalette function
6
7
:param int: N: number of output colors.
8
9
:param colors: input colors, any number of colors with 0 < ncolors <=
10
N is okay.
Copied!

get_random_colors [#684]

Check the source code online
1
def get_random_colors(n_colors=1):
Copied!
  docstring:
1
:param n_colors: (Default value = 1)
Copied!

check_colors [#701]

Check the source code online
1
def check_colors(color):
Copied!
  docstring:
1
:param color: color
Copied!
Last modified 1yr ago