HTML Color Chart

Discussion in 'HTML' started by humbads, Mar 27, 2005.

  1. humbads

    humbads Guest

    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.
    humbads, Mar 27, 2005
    #1
    1. Advertising

  2. 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

    "humbads" <> wrote in message
    news:...
    > 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.
    >
    Duncan Greenhill, Mar 27, 2005
    #2
    1. Advertising

  3. humbads

    humbads Guest

    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";
    }
    humbads, Mar 27, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy
    Replies:
    3
    Views:
    38,221
    moondaddy
    Apr 28, 2004
  2. Larry
    Replies:
    13
    Views:
    1,115
    Larry
    Nov 6, 2006
  3. gnewsgroup
    Replies:
    4
    Views:
    2,990
    Kevin Spencer
    Feb 6, 2008
  4. Tarek
    Replies:
    6
    Views:
    305
    Chris Hohmann
    Nov 19, 2004
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    391
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page