C++ API#

See doxygen output: tdegeus.github.io/cppcolormap

Copyright

Copyright. Tom de Geus. All rights reserved.

License: This project is released under the GPLv3 License.

Defines

CPPCOLORMAP_ASSERT(expr)#

All assertions are implementation as:

GMATTENSOR_ASSERT(...)
They can be enabled by:
#define GMATTENSOR_ENABLE_ASSERT
(before including GMatTensor). The advantage is that:

  • File and line-number are displayed if the assertion fails.

  • GMatTensor’s assertions can be enabled/disabled independently from those of other libraries.

Throws std::runtime_error

CPPCOLORMAP_VERSION#

Current version.

Either:

  • Configure using CMake at install time. Internally uses::

    python -c "from setuptools_scm import get_version; print(get_version())"
    

  • Define externally using::

    MYVERSION=`python -c "from setuptools_scm import get_version; print(get_version())"`
    -DCPPCOLORMAP_VERSION="$MYVERSION"
    
    From the root of this project. This is what setup.py does.

Note that both CMakeLists.txt and setup.py will construct the version using setuptools_scm. Tip: use the environment variable SETUPTOOLS_SCM_PRETEND_VERSION to overwrite the automatic version.

namespace cppcolormap#

Enums

enum metric#

Algorithm to use for color matching.

Values:

enumerator euclidean#

Euclidean norm.

enumerator fast_perceptual#

Fast best perception algorithm.

See: https://stackoverflow.com/a/1847112/2646505

enumerator perceptual#

Best perception algorithm. See: https://en.wikipedia.org/wiki/Color_difference.

Functions

inline std::string version()#

Return version string.

E.g.: "0.1.0".

Returns

String.

inline std::vector<std::string> version_dependencies()#

Return versions of this library and of all of its dependencies.

The output is a list of strings, e.g.

"cppcolormap=1.0.0",
"xtensor=0.20.1"
...

Returns

List of strings.

template<class T, typename std::enable_if_t<xt::get_rank<T>::value != 1, int> = 0>
std::vector<std::string> rgb2hex(const T &arg)#

Convert RGB -> HEX.

Parameters

arg – RGB data (values between 0 and 1).

Returns

Vector of strings.

template<class T, typename std::enable_if_t<xt::get_rank<T>::value == 1, int> = 0>
std::string rgb2hex(const T &arg)#

Convert RGB -> HEX.

Parameters

arg – RGB data (values between 0 and 1).

Returns

String.

array_type::tensor<double, 2> hex2rgb(const std::vector<std::string> &arg)#

Convert HEX -> RGB.

Parameters

arg – HEX data.

Returns

RGB data.

array_type::tensor<double, 1> hex2rgb(const std::string &arg)#

Convert HEX -> RGB.

Parameters

arg – HEX data.

Returns

RGB data.

template<class T, class R = array_type::tensor<double, 2>>
inline R interp(const T &arg, size_t N)#

Interpolate the individual colours.

Parameters
  • arg – RGB data.

  • N – Number of colors to output.

Returns

RGB data.

template<class E, class C, typename S>
inline auto as_colors(const E &data, const C &colors, S vmin, S vmax)#

Convert data to colors using a colormap.

Parameters
  • data – The data.

  • colors – The colormap, e.g. cppcolormap::jet().

  • vmin – The lower limit of the color-axis.

  • vmax – The upper limit of the color-axis.

template<class E, class C>
inline auto as_colors(const E &data, const C &colors)#

Convert data to colors using a colormap.

Parameters
inline array_type::tensor<double, 2> Accent(size_t N = 8)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Dark2(size_t N = 8)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Paired(size_t N = 12)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Spectral(size_t N = 11)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Pastel1(size_t N = 9)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Pastel2(size_t N = 8)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set1(size_t N = 9)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set2(size_t N = 8)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set3(size_t N = 12)#

Qualitative colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Blues(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Greens(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Greys(size_t N = 2)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Oranges(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Purples(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Reds(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BuPu(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> GnBu(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuBu(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuBuGn(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuRd(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdPu(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> OrRd(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdOrYl(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlGn(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlGnBu(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlOrRd(size_t N = 9)#

Sequential colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BrBG(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuOr(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdBu(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdGy(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdYlBu(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdYlGn(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PiYG(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PRGn(size_t N = 11)#

Diverging colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> spring(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> summer(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> autumn(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> winter(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> bone(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> cool(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> hot(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> copper(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> hsv(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> nipy_spectral(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> jet(size_t N = 256)#

matplotlib colormap, from anchor.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> terrain(size_t N = 6)#

matplotlib colormap, from fraction.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> afmhot(size_t N = 256)#

GNU plot colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> magma(size_t N = 256)#

matplotlib colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> inferno(size_t N = 256)#

matplotlib colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> plasma(size_t N = 256)#

matplotlib colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> viridis(size_t N = 256)#

matplotlib colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> seismic(size_t N = 5)#

matplotlib colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> White(size_t N = 1)#

Monotone colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Grey(size_t N = 1)#

Monotone colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Black(size_t N = 1)#

Monotone colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Red(size_t N = 1)#

Monotone colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Blue(size_t N = 1)#

Monotone colormap.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> tuewarmred(size_t N = 1)#

Eindhoven University of Technology.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> tuedarkblue(size_t N = 1)#

Eindhoven University of Technology.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> tueblue(size_t N = 1)#

Eindhoven University of Technology.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> tuelightblue(size_t N = 1)#

Eindhoven University of Technology.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Apricot(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Aquamarine(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Bittersweet(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BlueGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BlueViolet(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BrickRed(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Brown(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BurntOrange(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> CadetBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> CarnationPink(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Cerulean(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> CornflowerBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Cyan(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Dandelion(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> DarkOrchid(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Emerald(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> ForestGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Fuchsia(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Goldenrod(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Gray(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Green(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> GreenYellow(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> JungleGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Lavender(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> LimeGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Magenta(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Mahogany(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Maroon(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Melon(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> MidnightBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Mulberry(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> NavyBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> OliveGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Orange(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> OrangeRed(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Orchid(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Peach(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Periwinkle(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PineGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Plum(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> ProcessBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Purple(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RawSienna(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RedOrange(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RedViolet(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Rhodamine(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RoyalBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RoyalPurple(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RubineRed(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Salmon(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> SeaGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Sepia(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> SkyBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> SpringGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Tan(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> TealBlue(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Thistle(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Turquoise(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Violet(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> VioletRed(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> WildStrawberry(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Yellow(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YellowGreen(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YellowOrange(size_t N = 1)#

dvips color.

See: https://en.wikibooks.org/wiki/LaTeX/Colors

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Accent_r(size_t N = 8)#

Inverse of cppcolormap::Accent.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Dark2_r(size_t N = 8)#

Inverse of cppcolormap::Dark2.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Paired_r(size_t N = 12)#

Inverse of cppcolormap::Paired.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Spectral_r(size_t N = 11)#

Inverse of cppcolormap::Spectral.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Pastel1_r(size_t N = 9)#

Inverse of cppcolormap::Pastel1.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Pastel2_r(size_t N = 8)#

Inverse of cppcolormap::Pastel2.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set1_r(size_t N = 9)#

Inverse of cppcolormap::Set1.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set2_r(size_t N = 8)#

Inverse of cppcolormap::Set2.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Set3_r(size_t N = 12)#

Inverse of cppcolormap::Set3.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Blues_r(size_t N = 9)#

Inverse of cppcolormap::Blues.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Greens_r(size_t N = 9)#

Inverse of cppcolormap::Greens.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Greys_r(size_t N = 2)#

Inverse of cppcolormap::Greys.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Oranges_r(size_t N = 9)#

Inverse of cppcolormap::Oranges.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Purples_r(size_t N = 9)#

Inverse of cppcolormap::Purples.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> Reds_r(size_t N = 9)#

Inverse of cppcolormap::Reds.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BuPu_r(size_t N = 9)#

Inverse of cppcolormap::BuPu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> GnBu_r(size_t N = 9)#

Inverse of cppcolormap::GnBu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuBu_r(size_t N = 9)#

Inverse of cppcolormap::PuBu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuBuGn_r(size_t N = 9)#

Inverse of cppcolormap::PuBuGn.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuRd_r(size_t N = 9)#

Inverse of cppcolormap::PuRd.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdPu_r(size_t N = 9)#

Inverse of cppcolormap::RdPu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> OrRd_r(size_t N = 9)#

Inverse of cppcolormap::OrRd.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdOrYl_r(size_t N = 9)#

Inverse of cppcolormap::RdOrYl.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlGn_r(size_t N = 9)#

Inverse of cppcolormap::YlGn.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlGnBu_r(size_t N = 9)#

Inverse of cppcolormap::YlGnBu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> YlOrRd_r(size_t N = 9)#

Inverse of cppcolormap::YlOrRd.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> BrBG_r(size_t N = 11)#

Inverse of cppcolormap::BrBG.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PuOr_r(size_t N = 11)#

Inverse of cppcolormap::PuOr.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdBu_r(size_t N = 11)#

Inverse of cppcolormap::RdBu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdGy_r(size_t N = 11)#

Inverse of cppcolormap::RdGy.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdYlBu_r(size_t N = 11)#

Inverse of cppcolormap::RdYlBu.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> RdYlGn_r(size_t N = 11)#

Inverse of cppcolormap::RdYlGn.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PiYG_r(size_t N = 11)#

Inverse of cppcolormap::PiYG.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> PRGn_r(size_t N = 11)#

Inverse of cppcolormap::PRGn.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> spring_r(size_t N = 256)#

Inverse of cppcolormap::spring.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> summer_r(size_t N = 256)#

Inverse of cppcolormap::summer.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> autumn_r(size_t N = 256)#

Inverse of cppcolormap::autumn.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> winter_r(size_t N = 256)#

Inverse of cppcolormap::winter.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> bone_r(size_t N = 256)#

Inverse of cppcolormap::bone.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> cool_r(size_t N = 256)#

Inverse of cppcolormap::cool.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> hot_r(size_t N = 256)#

Inverse of cppcolormap::hot.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> copper_r(size_t N = 256)#

Inverse of cppcolormap::copper.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> hsv_r(size_t N = 256)#

Inverse of cppcolormap::hsv.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> nipy_spectral_r(size_t N = 256)#

Inverse of cppcolormap::nipy_spectral.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> jet_r(size_t N = 256)#

Inverse of cppcolormap::jet.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> terrain_r(size_t N = 5)#

Inverse of cppcolormap::terrain.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> seismic_r(size_t N = 6)#

Inverse of cppcolormap::seismic.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> afmhot_r(size_t N = 256)#

Inverse of cppcolormap::afmhot.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> magma_r(size_t N = 256)#

Inverse of cppcolormap::magma.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> inferno_r(size_t N = 256)#

Inverse of cppcolormap::inferno.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> plasma_r(size_t N = 256)#

Inverse of cppcolormap::plasma.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> viridis_r(size_t N = 256)#

Inverse of cppcolormap::viridis.

Parameters

N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> colormap(const std::string &cmap, size_t N = 256)#

Get colormap specified as string.

Parameters
  • cmap – Name of the colormap.

  • N – Number of colors to output.

Returns

RGB data.

inline array_type::tensor<double, 2> xterm()#

xterm color-cyle.

Returns

RGB data.

inline array_type::tensor<double, 2> tue()#

Eindhoven University of Technology color-cyle.

Returns

RGB data.

inline array_type::tensor<double, 2> xterm_r()#

Inverse of cppcolormap::xterm.

Returns

RGB data.

inline array_type::tensor<double, 2> tue_r()#

Inverse of cppcolormap::tue.

Returns

RGB data.

inline array_type::tensor<double, 2> colorcycle(const std::string &cmap)#

Get color-cycle specified as string.

Parameters

cmap – Name of the colormap.

Returns

RGB data.

inline array_type::tensor<size_t, 1> match(const array_type::tensor<double, 2> &A, const array_type::tensor<double, 2> &B, metric distance_metric = euclidean)#

Match colors.

Parameters
  • A – List of colors.

  • B – List of colors.

  • distance_metric – Metric to use in color matching.

Returns

For each item in A, the index of the closets corresponding color in B.

namespace array_type#

Container type.

Typedefs

template<typename T, size_t N>
using tensor = xt::xtensor<T, N>#

Fixed (static) rank array.