Voici un extrait d'un futur projet. Aucun des thèmes de couleurs par défaut ne fait ce que je veux (en rendant les nombres à chaque extrémité noirs ou gris), j'ai donc passé une définition de thème pour chauffer la couleur pour le 2ème argument (au lieu du nom d'un thème par défaut).
colors = Heat Color(
// the first argument is a JSL matrix for efficiency:
(0 :: 800) / 800, // 800 pixels wide, smoothly interpolated by heatcolor
// the second argument is a list that specifies the color theme
{"", // no name or flags needed, just the name placeholder
{ // this theme uses 12 colors
RGB Color( 0, 0, 0 ), // black
HLS Color( 4.0 / 10.0, .3, 1 ), // darken beginning
HLS Color( 5.0 / 10.0, .5, 1 ), //
HLS Color( 6.0 / 10.0, .5, 1 ), //
HLS Color( 7.0 / 10.0, .5, 1 ), //
HLS Color( 8.0 / 10.0, .5, .7 ), // desaturate magenta
HLS Color( 9.0 / 10.0, .5, 1 ), //
HLS Color( 0.0 / 10.0, .5, 1 ), //
HLS Color( 1.0 / 10.0, .5, 1 ), //
HLS Color( 2.0 / 10.0, .5, 1 ), //
HLS Color( 3.0 / 10.0, .3, 1 ), // darken ending
RGB Color( .5, .5, .5 ) // gray
},
// this theme positions the 12 colors between 0 and 1, inset from the ends
As List( (1 :: 12) / 13 )[1] // positions 1/13 ... 12/13
}
);
For( i = 1, i <= 8, i++, // double the height several times
colors = colors |/ colors
);
pic = New Image( colors ); // matrix to image
New Window( "Demo Heat Color", pic ); // display
Showing the wash of color from Left to Right matching the color theme specificationAffichage du lavis de couleur de gauche à droite correspondant aux spécifications du thème de couleur
Voici une autre approche.