Op zondag 11 nov 2012 11:34 CET schreef Cecil Westerhof:
I thought that it was perhaps a good idea to show my solution. It is
not the best code (I am still learning to program in postscript) and I
am using a library (but only for the creating of a font and
centerString if I remember well).
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 595 842
/pageBottom 0 def
/pageLeft 0 def
/pageRight 595 def
/pageTop 842 def
#standard
% Library init
/authorFont 8 def
/backgroundGray .9 def
/usedFont /Bookman-ISOLatin1 findfont def
% Program functions
/displayColour { % r g b colour left bottom right top
5 dict begin
/top exch def
/right exch def
/bottom exch def
/left exch def
/colour exch def
colour right left sub 2 div left add top 10 add centerString
left bottom right top rectangle
gsave
setrgbcolor
fill
grestore
stroke
end
} def
/displayRow {
10 bottom 85 top displayColour
110 bottom 185 top displayColour
210 bottom 285 top displayColour
310 bottom 385 top displayColour
410 bottom 485 top displayColour
510 bottom 585 top displayColour
} def
% Program init
usedFont
authorFont scalefont
setfont
colorWhite ()
colorWhite ()
colorWhite ()
colorWhite ()
colorWhite ()
colorYellowGreen (YellowGreen)
colorYellow (Yellow)
colorWhite (White)
colorWheat (Wheat)
colorVioletRed (VioletRed)
colorViolet2 (Violet2)
colorViolet (Violet)
colorVeryLightGrey (VeryLightGrey)
colorVeryDarkBrown (VeryDarkBrown)
colorTurquoise (Turquoise)
colorThistle (Thistle)
colorTeal (Teal)
colorTan (Tan)
colorSummerSky (SummerSky)
colorSteelBlue (SteelBlue)
colorSpringGreen (SpringGreen)
colorSpicyPink (SpicyPink)
colorSlateBlue (SlateBlue)
colorSkyBlue (SkyBlue)
colorSilver (Silver)
colorSienna (Sienna)
colorSemiSweetChocolate (SemiSweetChocolate)
colorSeaShell (SeaShell)
colorSeaGreen (SeaGreen)
colorScarlet (Scarlet)
colorSalmon (Salmon)
colorRichBlue (RichBlue)
colorRed (Red)
colorQuartz (Quartz)
colorPurple (Purple)
colorPlum (Plum)
colorPink (Pink)
colorPeachPuff (PeachPuff)
colorPaleTurquoise (PaleTurquoise)
colorPaleGreen (PaleGreen)
colorOrchid (Orchid)
colorOrangeRed (OrangeRed)
colorOrange (Orange)
colorOlive (Olive)
colorOldGold (OldGold)
colorNewTan (NewTan)
colorNewMidnightBlue (NewMidnightBlue)
colorNeonPink (NeonPink)
colorNeonBlue (NeonBlue)
colorNavyBlue (NavyBlue)
colorNavy (Navy)
colorMidnightBlue (MidnightBlue)
colorMediumWood (MediumWood)
colorMediumVioletRed (MediumVioletRed)
colorMediumTurquoise (MediumTurquoise)
colorMediumSpringGreen (MediumSpringGreen)
colorMediumSlateBlue (MediumSlateBlue)
colorMediumSeaGreen (MediumSeaGreen)
colorMediumOrchid (MediumOrchid)
colorMediumForestGreen (MediumForestGreen)
colorMediumBlue (MediumBlue)
colorMediumAquamarine (MediumAquamarine)
colorMaroon2 (Maroon2)
colorMaroon (Maroon)
colorMandarianOrange (MandarianOrange)
colorLimeGreen (LimeGreen)
colorLime (Lime)
colorLightSteelBlue (LightSteelBlue)
colorLightGrey2 (LightGrey2)
colorLightGrey (LightGrey)
colorLightBlue (LightBlue)
colorKhaki (Khaki)
colorIndigo (Indigo)
colorIndianRed (IndianRed)
colorHunterGreen (HunterGreen)
colorHoneydew (Honeydew)
colorGreen (Green)
colorGrey (Grey)
colorGreenYellow (GreenYellow)
colorGreenCopper (GreenCopper)
colorGreen (Green)
colorGoldenrod (Goldenrod)
colorGold (Gold)
colorFuchsia (Fuchsia)
colorForestGreen (ForestGreen)
colorFirebrick (Firebrick)
colorFeldspar (Feldspar)
colorFuchsia (Fuchsia)
colorDustyRose (DustyRose)
colorDimGrey (DimGrey)
colorDarkWood (DarkWood)
colorDarkTurquoise (DarkTurquoise)
colorDarkTan (DarkTan)
colorDarkSlateGrey (DarkSlateGrey)
colorDarkSlateBlue (DarkSlateBlue)
colorDarkPurple (DarkPurple)
colorDarkOrchid (DarkOrchid)
colorDarkOliveGreen (DarkOliveGreen)
colorDarkGreenCopper (DarkGreenCopper)
colorDarkGreen (DarkGreen)
colorDarkBrown (DarkBrown)
colorCyan (Cyan)
colorCornFlowerBlue (CornFlowerBlue)
colorCoral (Coral)
colorCopper (Copper)
colorCoolCopper (CoolCopper)
colorCadetBlue (CadetBlue)
colorBronzeII (BronzeII)
colorBronze (Bronze)
colorBrown (Brown)
colorBrightGold (BrightGold)
colorBrass (Brass)
colorBlueViolet (BlueViolet)
colorBlue (Blue)
colorBlack (Black)
colorBakersChocolate (BakersChocolate)
colorBeige (Beige)
colorAzure (Azure)
colorAliceblue (Aliceblue)
colorAquamarine (Aquamarine)
% Program
.9 grayBackground
/bottom 800 def
/top 825 def
displayRow
/bottom 750 def
/top 775 def
displayRow
/bottom 700 def
/top 725 def
displayRow
/bottom 650 def
/top 675 def
displayRow
/bottom 600 def
/top 625 def
displayRow
/bottom 550 def
/top 575 def
displayRow
/bottom 500 def
/top 525 def
displayRow
/bottom 450 def
/top 475 def
displayRow
/bottom 400 def
/top 425 def
displayRow
/bottom 350 def
/top 375 def
displayRow
/bottom 300 def
/top 325 def
displayRow
/bottom 250 def
/top 275 def
displayRow
/bottom 200 def
/top 225 def
displayRow
/bottom 150 def
/top 175 def
displayRow
/bottom 100 def
/top 125 def
displayRow
/bottom 50 def
/top 75 def
displayRow
showpage
.9 grayBackground
/bottom 800 def
/top 825 def
displayRow
/bottom 750 def
/top 775 def
displayRow
/bottom 700 def
/top 725 def
displayRow
/bottom 650 def
/top 675 def
displayRow
showpage