Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2004
    Location
    Minnesota
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Darken Hex Color?

    Ok, I have a function being passed hex color values, however I need them a bit darken than what they actually are (think #eaeaea instead of #ffffff). So I guess my question is this, can this be done with JS?

    I was thinking I could just convert the hex to RGB somehow and then add '20' or whatever onto each value so long as its not greater than 235. Or SOMETHING along those lines.

    Will this work, and if so does anyone know of a good script to start with for RGB conversion?

    Cheers!!
    “That rug really tied the room together. ”

  • #2
    New Coder
    Join Date
    Dec 2004
    Location
    Minnesota
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah...! i found this after a little diggin' Works great!

    http://www.codingforums.com/archive/index.php?t-86375.html
    “That rug really tied the room together. ”


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •