NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page HEX colors - get same color a bit paler?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-29-2006, 03:14 PM THREAD STARTER               #1 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



HEX colors - get same color a bit paler?


Hi. Is there any way to take a hex code color, and then get the same color a bit paler?

IE: If I had #000000, it may output #c0c0c0

Is there any way of doing that?

Thanks
Tom
PoorDoggie is offline  
Old 08-29-2006, 05:51 PM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
You can do it with RGB colors.
Code:
<script type="text/javascript">
function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}
function toR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function toG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function toB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function hex(h) {document.getElementById('rgb').value = 'rgb('+toR(h)+','+toG(h)+','+toB(h)+')'}
</script>

<input type="text" onkeyup="hex(this.value);"> <input type="text" id="rgb">
Use that to get your colors into RGB. [I set it up to give you the RGB in CSS form..]
????: NamePros.com http://www.namepros.com/programming/232819-hex-colors-get-same-color-bit.html

Then when you have the RGB, you can just add the same number to each one to make it lighter.
Dan is offline  
Old 08-30-2006, 01:54 AM THREAD STARTER               #3 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



you are amazing, thank you!!!
PoorDoggie is offline  
Old 08-30-2006, 01:09 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
-removed-
Last edited by Dan Friedman; 09-17-2006 at 07:27 PM.
Dan is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:22 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger