(Created page with "= ''Mathematica'' colours = Mathematica has a rather extensive support for colors, but more often than not, it needs tinkering with. We like to use the ''SunsetColors'' ...") |
m (→Mathematica colours) |
||
Line 14: | Line 14: | ||
lcol[n_] := | lcol[n_] := | ||
Module[{}, Table[ColorData["SunsetColors"][i], {i, 0, 1, 1/(n - 1)}]] | Module[{}, Table[ColorData["SunsetColors"][i], {i, 0, 1, 1/(n - 1)}]] | ||
+ | </pre> | ||
+ | |||
+ | A blending of colors can be done with <tt>blend</tt>, e.g., that generates a smooth transition from red to blue in <tt>n</tt> steps: | ||
+ | |||
+ | <pre> | ||
+ | Table[{Blend[{Red, Blue}, x]}, {x, 0, 1, 1/(n+1)}] | ||
</pre> | </pre> |
Mathematica has a rather extensive support for colors, but more often than not, it needs tinkering with.
We like to use the SunsetColors color scheme:
ColorData["SunsetColors"]
This module exports a list of n colors distributed along the gradient:
lcol[n_] := Module[{}, Table[ColorData["SunsetColors"][i], {i, 0, 1, 1/(n - 1)}]]
A blending of colors can be done with blend, e.g., that generates a smooth transition from red to blue in n steps:
Table[{Blend[{Red, Blue}, x]}, {x, 0, 1, 1/(n+1)}]