Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.advocacy > #410839

Re: W3C/WCAG 2.0 Relative Luminance ( perceived ).

From Snit <usenet@gallopinginsanity.com>
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 2017-04-23 12:21 -0700
Message-ID <D5224CE7.A0FAC%usenet@gallopinginsanity.com> (permalink)
References (3 earlier) <D517EC19.9F314%usenet@gallopinginsanity.com> <op.yy3xg2kajs98qf@red.lan> <rMNKA.6920$7Y5.5504@fx13.iad> <Jeff-Relf.Me@Apr.22--2.42P.Seattle.2017> <7D6LA.23054$wc5.3302@fx14.iad>

Cross-posted to 4 groups.

Show all headers | View raw


On 4/23/17, 11:45 AM, in article 7D6LA.23054$wc5.3302@fx14.iad, "Mark Lloyd"
<not@mail.invalid> 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.

<https://youtu.be/H4NW-Cqh308>

Back to comp.os.linux.advocacy | Previous | NextPrevious in thread | Find similar


Thread

Re: Apple told to warn against charging phone in bath after man's electrocution "James Wilkinson Sword" <imvalid@somewear.com> - 2017-04-22 18:28 +0100
  Re: Apple told to warn against charging phone in bath after man's electrocution Snit <usenet@gallopinginsanity.com> - 2017-04-22 10:46 -0700
  Re: Apple told to warn against charging phone in bath after man's electrocution Mark Lloyd <not@mail.invalid> - 2017-04-22 14:01 -0500
    Re: Apple told to warn against charging phone in bath after man's electrocution "James Wilkinson Sword" <imvalid@somewear.com> - 2017-04-22 20:26 +0100
    Re: Apple told to warn against charging phone in bath after man's electrocution Snit <usenet@gallopinginsanity.com> - 2017-04-22 12:30 -0700
      Re: Apple told to warn against charging phone in bath after man's electrocution "James Wilkinson Sword" <imvalid@somewear.com> - 2017-04-22 21:26 +0100
        Re: Apple told to warn against charging phone in bath after man's electrocution Snit <usenet@gallopinginsanity.com> - 2017-04-22 15:24 -0700
      Re: Apple told to warn against charging phone in bath after man's electrocution Mark Lloyd <not@mail.invalid> - 2017-04-23 13:34 -0500
        Re: Apple told to warn against charging phone in bath after man's electrocution Snit <usenet@gallopinginsanity.com> - 2017-04-23 12:10 -0700
    Re: Apple told to warn against charging phone in bath after man's electrocution Snit <usenet@gallopinginsanity.com> - 2017-04-22 12:55 -0700
    Re: W3C/WCAG 2.0 Relative Luminance ( perceived ). Mark Lloyd <not@mail.invalid> - 2017-04-23 13:45 -0500
      Re: W3C/WCAG 2.0 Relative Luminance ( perceived ). Snit <usenet@gallopinginsanity.com> - 2017-04-23 12:21 -0700

csiph-web