Generate a "random" color set Your challenge is to write a program that takes input from stdin, creates a set of 1 to ncolors and outputs them on stdout, formatted as a 6-digit-hex value with a prefixed #.

The starting color should have following values (in a hsv colorspace) (pesudocode)

h=rand(), s=0.5, v=0.95.


Every subsequent color should have its hue value increased by

1/Φ


After every 5th color, the saturation and value for the forthcoming colors should be

saturation - increased by 0.1
value - decreased by 0.2



e.g.
Color  #    h         s       v  
       1  0.5        0.5     0.95
       2  0.118...   0.5     0.95
      11  0.680...   0.7     0.55

Input
Your program shall receive an Integer nas input (stdin), which defines the number of colors, to be generated. Where 0 &lt; n &lt; 16
Output

On each call, the hues' start value  should be different from the last call (Don't just take the same random start number on every call)
Output should be on stdout with one color per line.
The array shall contain n different hex codes.
The hex codes should be prefixed with a &quot;#&quot; and be padded with a &quot;0&quot;, such that you always get a 7 character string like &quot;#FFFFFF&quot;

Additional Rules

The use of built in functions/tools/etc  for the following conversions is forbidden

HSV-&gt;RGB
RGB-&gt;HEX representation of RGBa function which specifically converts rgb to hex, generic tools like sprintf are ok.
HSV-&gt;HEX representation of RGBjust to make sure...



Scoring
The size of your code in bytes.
Test Cases(result of rand() in parantheses)
3 (0.35389856481924653) -&gt; 
    #79f388
    #f3798e
    #79b1f3
    
8 (0.763850917108357) -&gt; 
    #c079f3
    #79f39d
    #f37979
    #4c6ec0
    #90c04c
    #c04cb1
    #4cc0ac
    #c08b4c
    
15 (0.10794945224188268) -&gt; 
    #f3c879
    #a479f3
    #79f381
    #f37995
    #79b8f3
    #aac04c
    #b44cc0
    #4cc092
    #c0704c
    #4f4cc0
    #448c2a
    #8c2a61
    #2a7e8c
    #8c7e2a
    #612a8c 

for a visualization of the codes, you can paste your output here
I will change the accepted Answer, as soon as new appear
Python 184 bytes

from random import*
h,s,v=random()*6,.5,243.2
for i in range(input()):
 h+=3.708;print'#'+'%02x'*3%((v,v-v*s*abs(1-h%2),v-v*s)*3)[5**int(h)/3%3::int(h)%2+1][:3]
 if i%5/4:s+=.1;v-=51.2


The HSV &rArr; RGB conversion is taken directly from wikipedia.

A few implementation notes.


h is defined as its proper value times 6, which simplifies region determination.
v is defined as its proper value times 256, which propagates through to all three RGB values.
6/&Phi;  (approximately ~3.708) is used instead of 1/&Phi;, in agreement with the scaling of h. Similarly, the decrement value for v is also scaled by 256.
The bit of magic
((v,v-v*s*abs(1-h%2),v-v*s)*3)[5**int(h)/3%3::int(h)%2+1][:3]
is logically equivalent to
c=v*s;m=v-c;x=c-c*abs(1-h%2)+m;c+=m;[(c,x,m),(x,c,m),(m,c,x),(m,x,c),(x,m,c),(c,m,x)][int(h)%6]


Sample usage:

$ echo 3 | python color-set.py
#f37994
#79b8f3
#dbf379

$ echo 8 | python color-set.py
#d2f379
#f079f3
#79f3cc
#f3a979
#8579f3
#62c04c
#c04c84
#4ca6c0

$ echo 15 | python color-set.py
#7984f3
#a8f379
#f379cb
#79eff3
#f3d379
#804cc0
#4cc05e
#c04c5c
#4c7dc0
#9fc04c
#8b2a8c
#2a8c6f
#8c522a
#352a8c
#3b8c2a


A visualization of the values for n = 15:

and the corresponding html.