$max){ return $max - ($in-1) ; } return $in ; } // returns a random 6 digit hex number function getRandomHexString(){ $hexDigits = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F') ; $keys = array_rand($hexDigits, 6) ; foreach($keys as $key){ shuffle($hexDigits) ; $digits[] = $hexDigits[$key] ; } return $digits ; } // returns a random 18 hex digit 'genome' function getRandomGenome(){ $genome = "" ; for($i=0;$i<3;$i++){ $genome .= implode('',getRandomHexString()) ; } return $genome ; } /* returns an array contaning 3 valid HTML colour values when given an 18 digit genome */ function decodeGenome($genome){ $offset = 0; while($offset < strlen($genome)){ $colours[] = '#' . substr($genome, $offset, 6) ; $offset += 6 ; } return $colours ; } // returns a mutated version of the input genome function mutate($inputGenome){ $hexDigits = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F') ; $genome = "" ; for($ind=0;$ind Genetic Colour Scheme Designer

Genetic Colour Scheme Designer

What is this?

How to Use

  1. Select the colour scheme you most like by clicking on it.
  2. Once the page has reloaded that colour scheme will become the central colour scheme and its colour values will be indicated below it.
  3. Keep selecting your favourite colour scheme until you are happy with the one you have.
' ; for($i=0;$i<3;$i++){ echo '' ; for($j=0;$j<3;$j++){ $thisGenome = $siblings[(($i)*3) + $j] ; $colours = decodeGenome($thisGenome) ; echo '' ; echo <<
Example Text
BLOCK; if(1 == $i && 1 == $j){ echo << DISP; } echo '' ; } echo '' ; } echo '' ; ?> Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 License . View the source code.