Home
Source Tarball | Source Zip

This little page does a few nifty things via PHP:

  • Generates a random quantity, between 1 and 100, of hex color codes.
  • Calculates the best color, either black or white, to use for the text to show up when displayed on top of the color.
  • Populates a little div block with the color as background and the label with the white or black text.
  • Calculates two darker shades of the color to be applied to the various parts of the object.
  • Randomly picks one of two different object templates. One faces left, the other, right.
  • Paints three of the parts of the object shown below
  • Combines each of the four parts as layers into a single little object image to be displayed next to its color block.
  • This is the right-facing template:

0E8F5B
F64808
E1B843
6F1162
4772ED
447B9C
9D2265
4DD4B2
09D129
5BB449
EDA507
976718
B4CE20
EF01B4
B5A6A2
BA5024
BADE35
F58FC9
CFD0D4
D3A720
10903F
2AB3BF
ED0518
CC376A