That would be a Javascript job. It wouldn't be too difficult to have a loop that builds a table of websafe colours. Maybe give individual cells a background of that colour and put a link inside the cell (use the hex value for the cell text I suppose).
The link would be to the page that puts the colour in the database, with a querystring that specifies the hex value.
action.php?colour=FF9900
say, and in action.php stuff the value of $_GET['colour'] into the database (after of course first checking to see if it's a proper colour hex value!)
If you're interested, the loop would go from 0 to 215 inclusive. If i is the loop counter, the corresponding hex code is
var d2h='0369CF'; // Best outside the loop!
b = i%6;
g = ((i-b)/6)%6;
r = ((i-g)/6)%6;
b = substr(d2h,b,1);
g = substr(d2h,g,1);
r = substr(d2h,r,1);
hex = '' + b + b + g + g + r + r;
(assuming that's proper Javascript, I forget for the instant if its substr() function looks exactly like that).
Note that I haven't bothered with the # - might as well leave that for when it's actually used. You'd only have to escape it as %23 to put it in the querystring anyway.