home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 7,925 of 9,834   
   Jim Moseley to All   
   Re: Fonts & Colors   
   13 Nov 06 17:16:13   
   
   From: jmose@mapson.attglobal.net   
      
   >Is there an easy way to determine whether a uiObject's color is too dark   
   >to use font.color=black, and instead replace it with font.color=white?   
      
      
   I hate to answer my own question, but I found an interesting post on another   
   newsgroup.   
      
   First, calculate the luminosity, which will have a range from 1 to 255.   
   Then use a white font if L < 127 and a black font if L >= 127.  Seems to   
   work pretty well.   
      
   Luminosity = Red*0.3 + Green*0.59 + Blue*0.11   
      
   Somehow this is tied in with black&white TVs showing color programs!  Here's   
   the link if anyone's interested.   
      
   Thanks,   
   Jim Moseley   
      
      
   http://groups.google.com/group/microsoft.public.excel.worksheet.   
   unctions/browse_thread/thread/2dee166ab1884522/0e45071dae108445?   
   nk=st&q=calculate+font+color+to+white+or+black&rnum=15&hl=en#0e45071dae108445   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca