Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Snit Newsgroups: comp.os.linux.advocacy,comp.sys.mac.system,alt.comp.os.windows-10,alt.cellular-phone-tech Subject: Re: W3C/WCAG 2.0 Relative Luminance ( perceived ). Date: Sun, 23 Apr 2017 12:21:59 -0700 Lines: 39 Message-ID: References: <7D6LA.23054$wc5.3302@fx14.iad> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net snegq9rbnLLmkPf4Fs5rdwvIpnpSItx2utl3CTzqIwjnplsWXy Cancel-Lock: sha1:tfALQcYOOoau3+XddFL/vyvZAM0= User-Agent: Microsoft-Entourage/12.36.0.130206 Thread-Topic: W3C/WCAG 2.0 Relative Luminance ( perceived ). Thread-Index: AdK8ZuC36IiVgIfjMkKYdEU+8p2cWA== Xref: csiph.com comp.os.linux.advocacy:410839 comp.sys.mac.system:105161 alt.comp.os.windows-10:40559 alt.cellular-phone-tech:1386 On 4/23/17, 11:45 AM, in article 7D6LA.23054$wc5.3302@fx14.iad, "Mark Lloyd" wrote: > On 04/22/2017 04:42 PM, Jeff-Relf.Me@. wrote: >> Mark Lloyd wrote: >>> Also, I use this formula to find the brightness of a RGB color: >>> brightness = red * .299 + green * .587 + blue * .114 >> >> // W3C/WCAG 2.0 Relative Luminance ( perceived ): >> >> Float g ; // g == Gamma == PerceivedBrightness, 0 to 1. >> g = .212655*gInv( R ) + .715158*gInv( G ) + .072187*gInv( B ); >> g = g <= .0031308 ? g*12.92 : 1.055*pow( g, 1/2.4 ) - .055 ; >> >> Global: >> >> // gInv() == InverseGamma. >> >> inline float gInv( float R ) { >> R /= 100 ; // R, G, and B are floats, 0..100% -- not 0..255. >> return R <= .04045 ? R / 12.92 : pow( ( R + .055 ) / 1.055, 2.4 ); >> } > > I intend to try this. Maybe it'll work better than the simple formula. If it does let me know and I might fiddle with my program just for the fun of it. Also might want to set it to change the bold color and more. Not that there is any real value to my doing so, but, hey, it keeps me out of trouble. :) -- Personal attacks from those who troll show their own insecurity. They cannot use reason to show the message to be wrong so they try to feel somehow superior by attacking the messenger. They cling to their attacks and ignore the message time and time again.