Goto Chapter: Top 1 2 3 4 5 6 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

3 The colors in the IntPic package
 3.1 Colors by tones
 3.2 Lists of colors
 3.3 The IntPic default list of colors
 3.4 Functions to deal with colors

3 The colors in the IntPic package

The idea in what concerns the colors is the following: the reader is free to choose his colors (taking into account that the latex xcolor package is used), but we try to make users life reasonably easy. He is allowed to choose tones. The default colors used by IntPic are not many, although (from our experience) sufficient for most examples.

3.1 Colors by tones

The colors are divided by tones.

gap> IP_ColorsRedTones; #red
[ "red", "red!50", "red!20", "red!80!green!50", "red!80!blue!60" ]



gap> IP_ColorsGreenTones; #green
[ "green", "green!50", "green!20", "green!80!red!50", "green!80!blue!60" ]



gap> IP_ColorsBlueTones; #blue
[ "blue", "blue!50", "blue!20", "blue!80!red!50", "blue!80!green!60" ]



gap> IP_ColorsCompRedTones; # cyan (complement of red)
[ "-red", "-red!50", "-red!20", "-red!80!green!50", "-red!80!blue!60" ]



gap> IP_ColorsCompGreenTones; # magenta (complement of green)
[ "-green", "-green!50", "-green!20", "-green!80!red!50", "-green!80!blue!60" 
 ]



gap> IP_ColorsCompBlueTones; # yellow (complement of blue)
[ "-blue", "-blue!50", "-blue!20", "-blue!80!red!50", "-blue!80!green!60" ]



gap> IP_ColorsDGrayTones; # dark gray
[ "black!80", "black!70", "black!60", "black!50", "black!40" ]



gap> IP_ColorsLGrayTones; # light gray
[ "black!30", "black!25", "black!20", "black!15", "black!10" ]



3.2 Lists of colors

gap> ListsOfIP_Colors;
[ [ "red", "red!50", "red!20", "red!80!green!50", "red!80!blue!60" ], 
  [ "green", "green!50", "green!20", "green!80!red!50", "green!80!blue!60" ], 
  [ "blue", "blue!50", "blue!20", "blue!80!red!50", "blue!80!green!60" ], 
  [ "-red", "-red!50", "-red!20", "-red!80!green!50", "-red!80!blue!60" ], 
  [ "-green", "-green!50", "-green!20", "-green!80!red!50", 
      "-green!80!blue!60" ], 
  [ "-blue", "-blue!50", "-blue!20", "-blue!80!red!50", "-blue!80!green!60" ],
  [ "black!80", "black!70", "black!60", "black!50", "black!40" ], 
  [ "black!30", "black!25", "black!20", "black!15", "black!10" ] ]
gap> IP_Colors;
[ "red", "red!50", "red!20", "red!80!green!50", "red!80!blue!60", "green", 
  "green!50", "green!20", "green!80!red!50", "green!80!blue!60", "blue", 
  "blue!50", "blue!20", "blue!80!red!50", "blue!80!green!60", "-red", 
  "-red!50", "-red!20", "-red!80!green!50", "-red!80!blue!60", "-green", 
  "-green!50", "-green!20", "-green!80!red!50", "-green!80!blue!60", "-blue", 
  "-blue!50", "-blue!20", "-blue!80!red!50", "-blue!80!green!60", "black!80", 
  "black!70", "black!60", "black!50", "black!40", "black!30", "black!25", 
  "black!20", "black!15", "black!10" ]

3.3 The IntPic default list of colors

The colors are shuffled by concatenating the transposed of the matrix ListsOfIP_Colors. The list obtained is taken as the default list of colors.

gap> ShuffledIP_colors;
[ "red", "green", "blue", "-red", "-green", "-blue", "black!80", "black!30", 
  "red!50", "green!50", "blue!50", "-red!50", "-green!50", "-blue!50", 
  "black!70", "black!25", "red!20", "green!20", "blue!20", "-red!20", 
  "-green!20", "-blue!20", "black!60", "black!20", "red!80!green!50", 
  "green!80!red!50", "blue!80!red!50", "-red!80!green!50", "-green!80!red!50",
  "-blue!80!red!50", "black!50", "black!15", "red!80!blue!60", 
  "green!80!blue!60", "blue!80!green!60", "-red!80!blue!60", 
  "-green!80!blue!60", "-blue!80!green!60", "black!40", "black!10" ]



These are the IntPic default colors. Although the user is free to use other colors, we warn that there is a need of compatibility with the colors used in other packages (the LaTeX xcolor, for instance). To emphasize the integers of some sets by using some of the colors in some list of colors (for instance the default colors) one may use empty lists to force the non usage of the colors whose order in the list of colors is the order of these empty lists in the array of integers to be emphasized.

gap> m3 := Filtered([1..40],i->i mod 3=0);
[ 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39 ]
gap> m5 := Filtered([1..40],i->i mod 5=0);
[ 5, 10, 15, 20, 25, 30, 35, 40 ]
gap> m7 := Filtered([1..40],i->i mod 7=0);
[ 7, 14, 21, 28, 35 ]
gap> 
gap> arr := [[],[],m3,[],m5,[],m7];;
gap> tkz:=IP_TikzArrayOfIntegers([1..40],10,rec(highlights:=arr));;



3.4 Functions to deal with colors

For the moment we only provide one function, which shuffles colors from lists of colors.

3.4-1 Shuffle colors from lists of colors
‣ ShuffleIP_Colors( mat )( function )

The argument mat is a list of lists of colors of the same length. The output is obtained by concatenating the transposed of mat.

gap> ShuffleIP_Colors([IP_ColorsRedTones,IP_ColorsCompBlueTones]);
[ "red", "-blue", "red!50", "-blue!50", "red!20", "-blue!20", 
  "red!80!green!50", "-blue!80!red!50", "red!80!blue!60", "-blue!80!green!60" 
 ]



 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 Bib Ind

generated by GAPDoc2HTML