Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner















Internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

General

This script will brighten or darken colors, preserving the true color hue. The color's hexadecimal numbers are displayed for further use.


Original color:
Scale factor:

Original New

Notes

Enter the original hexadecimal color value, either as a three-digit or six-digit value. Enter the scale factor (as an integer or a decimal value), and click the "Output" button in order to find the new hexadecimal color value. To darken the original color, enter a scale factor less than 1, such as .5. To brighten the original color, enter a scale factor like 5, to bring it five times closer towards white. Clicking on the bottom color bar will provide the hexadecimal number for that color in the scale, displayed in the "Output" box.

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: trueColor.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

2. From: Gord moscrip
not all hex colors work?
06/11/2008 15:33:19

Hi, when I get this to work is a handy tool.
Does not seem to like initial colors startinf with "f".
like ff0000, ffff00, etc..
e seems to be ok.
any help here?

3. From: Lee (Admin)
10/31/2008 14:40:58

Try using 3 digits, e.g., f00 or ff0.

1. From: Wayne
True Color Darkening and Lightening
06/02/2008 19:35:44

What an excellent tool for web page designers! It should be featured in every web design software as an alternative. It provides greater variety for those who manually create their own html than any other html colour selector that I am aware of. My rating: 10 out of 10.


Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.