HTML Color Chart

H

humbads

Here is an HTML Color Chart for your usage:

http://www.somacon.com/blog/page42.php

It contains a pallete of neutral colors, as well as a large,
general-purpose pallete. The difference between this one and many
others on the Internet is that it is formatted in a long vertical
table. This way, you can narrow the browser window with the pallete
next to your design, and pick out colors that appeal.
 
D

Duncan Greenhill

I like the look of it, but the text colour needs changing on some of them -
can't read name or hex code.
Regards,
Duncan
 
H

humbads

Yes, you're right. It looks much better when all the names and codes
are readable. Here is the formula I used for determining a text color
for each background color, in case you're interested.

// In PHP
// translate a background color like #ff00ff to a readable
// text color of white or black based on a formula
function getReadableTextColor($hexcolor)
{
if(substr($hexcolor,0,1) == "#") {
$hexcolor = substr($hexcolor, 1, 6);
}
$red = hexdec(substr($hexcolor, 0, 2));
$green = hexdec(substr($hexcolor, 2, 2));
$blue = hexdec(substr($hexcolor, 4, 2));
if($red + $green + $blue > 382) {
return "black";
}
return "white";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top