Click on colour.

Results legend:

http://www.w3.org/TR/AERT#color-contrast

0|0|00|0|510|0|1020|0|1530|0|2040|0|255
0|51|00|51|510|51|1020|51|1530|51|2040|51|255
0|102|00|102|510|102|1020|102|1530|102|2040|102|255
0|153|00|153|510|153|1020|153|1530|153|2040|153|255
0|204|00|204|510|204|1020|204|1530|204|2040|204|255
0|255|00|255|510|255|1020|255|1530|255|2040|255|255
51|0|051|0|5151|0|10251|0|15351|0|20451|0|255
51|51|051|51|5151|51|10251|51|15351|51|20451|51|255
51|102|051|102|5151|102|10251|102|15351|102|20451|102|255
51|153|051|153|5151|153|10251|153|15351|153|20451|153|255
51|204|051|204|5151|204|10251|204|15351|204|20451|204|255
51|255|051|255|5151|255|10251|255|15351|255|20451|255|255
102|0|0102|0|51102|0|102102|0|153102|0|204102|0|255
102|51|0102|51|51102|51|102102|51|153102|51|204102|51|255
102|102|0102|102|51102|102|102102|102|153102|102|204102|102|255
102|153|0102|153|51102|153|102102|153|153102|153|204102|153|255
102|204|0102|204|51102|204|102102|204|153102|204|204102|204|255
102|255|0102|255|51102|255|102102|255|153102|255|204102|255|255
153|0|0153|0|51153|0|102153|0|153153|0|204153|0|255
153|51|0153|51|51153|51|102153|51|153153|51|204153|51|255
153|102|0153|102|51153|102|102153|102|153153|102|204153|102|255
153|153|0153|153|51153|153|102153|153|153153|153|204153|153|255
153|204|0153|204|51153|204|102153|204|153153|204|204153|204|255
153|255|0153|255|51153|255|102153|255|153153|255|204153|255|255
204|0|0204|0|51204|0|102204|0|153204|0|204204|0|255
204|51|0204|51|51204|51|102204|51|153204|51|204204|51|255
204|102|0204|102|51204|102|102204|102|153204|102|204204|102|255
204|153|0204|153|51204|153|102204|153|153204|153|204204|153|255
204|204|0204|204|51204|204|102204|204|153204|204|204204|204|255
204|255|0204|255|51204|255|102204|255|153204|255|204204|255|255
255|0|0255|0|51255|0|102255|0|153255|0|204255|0|255
255|51|0255|51|51255|51|102255|51|153255|51|204255|51|255
255|102|0255|102|51255|102|102255|102|153255|102|204255|102|255
255|153|0255|153|51255|153|102255|153|153255|153|204255|153|255
255|204|0255|204|51255|204|102255|204|153255|204|204255|204|255
255|255|0255|255|51255|255|102255|255|153255|255|204255|255|255

PHP:0.40292739868164

PHP, safe colours PHP, more colours PHP, even more colours
JS, safe colours JS, more colours JS, even more colours
// 1 | 3 | 5 | 15 | 17 | 51 | 85