pjfl / p5-app-notitia

People and resource scheduling
2 stars 1 forks source link

Better contrast in text/vehicle colour #185

Closed JB62 closed 7 years ago

JB62 commented 7 years ago

Where there is text on a vehicle-colour background, need to make the text colour contrast so it's always legible. This seems to work pretty well...

use Graphics::ColorNames; sub text_colour { my $background = shift; my $po = new Graphics::ColorNames( qw( X ) ); my ($r, $g, $b) = $po->rgb($background); my $yiq = (($r299)+($g587)+($b*114))/1000; return ($yiq >= 128) ? 'black' : 'white'; }

JB62 commented 7 years ago

Pull request #186

pjfl commented 7 years ago

Will merge it after you've fixed the indirect object syntax

JB62 commented 7 years ago

Not sure I can face fighting git again.

-----Original Message----- From: Peter Flanigan notifications@github.com To: pjfl/p5-app-notitia p5-app-notitia@noreply.github.com Cc: John Sargent github@j-bg.co.uk, Assign assign@noreply.github.com Sent: Fri, 19 May 2017 8:00 p.m. Subject: Re: [pjfl/p5-app-notitia] Better contrast in text/vehicle colour (#185)

Will merge it after you've fixed the indirect object syntax

-- You are receiving this because you were assigned. Reply to this email directly or view it on GitHub: https://github.com/pjfl/p5-app-notitia/issues/185#issuecomment-302784826