project management, project management software, collaboration software - Copper Project  
 
FORUMS
"People actually use it, that makes my life easier!" Multimediums
 
   
Register  ::  Log in  ::  Search 

Post new topic | Reply to topic
 
 Solution for white text on light colored buttons, in Customization
 
ChiefGoFor
 
PostPosted: Wed Oct 24, 2007 3:59 pm    Post subject: Solution for white text on light colored buttons Reply with quote
Joined: 24 Oct 2007
Posts: 3

Here is my solution for white text on light colored buttons. The function analyzes what color has been selected as the background color and decides if it should use white text or black text.

Here is the code: http://www.chiefgofor.com/get_button_image.zip

This file contains basic PHP code, so reading and understanding it should not be an issue.

Just unzip and upload to a server that has PHP installed and then run the index.php file to see it in action.
The function is being called for the 216 web safe colors. It should show you a broad example of the color spectrum.
The threshold should be throttled to your liking. Any average over the threshold will have black text, and average under the threshold will have white text.
The parameters should be self explanatory. The function may need to be tweaked as the code that I was looking at was from the 2005 version.

Please let me know if you have any questions. Thanks!


Last edited by ChiefGoFor on Thu Oct 25, 2007 2:32 pm; edited 1 time in total
 
Ben
 
PostPosted: Thu Oct 25, 2007 12:32 am    Post subject: Reply with quote
Joined: 13 Mar 2003
Posts: 638

Thanks Chief that's fantastic!

Just to clarify for others, when you have a light coloured project colour (e.g. yellow) the light grey background on the button makes it hard to make out the save button, this code seeks to fix that issue.

Great to see this forum starting to kick off, if anyone else has any other mods they'd like to share by all means post them up here.
 
  Page 1 of 1





Tour | Sign-up | Demo & Free Trial | Buzz | FAQs | Forums | Blog | Contact
© Copyright Element Software 2001-2008 
Element Software - Creators of Copper Project Management Software