FLTK logo

[Library] r5748 - in branches/branch-1.1: . src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r5748 - in branches/branch-1.1: . src fltk-dev Mar 20, 2007  
 
Author: matt
Date: 2007-03-20 04:52:51 -0500 (Tue, 20 Mar 2007)
New Revision: 5748
Log:
Better contrast (#1625)

Modified:
   branches/branch-1.1/CHANGES
   branches/branch-1.1/src/fl_color.cxx

Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES	2007-03-20 09:42:36 UTC (rev 5747)
+++ branches/branch-1.1/CHANGES	2007-03-20 09:52:51 UTC (rev 5748)
@@ -4,6 +4,9 @@
 	  STR #1457, STR #1458, STR #1460, STR #1481, STR #1578)
 	- The sample RPM spec file now enables large file support
 	  and threading support (STR #1603)
+	- Changed minumu contrast between background and text to 
+	  96 and added more weight to the blue component to improve
+	  readability (STR #1625)
 	- Fixed VCNet OpenGL project file (STR #1617)
 	- Fixed scrolling of clipped areas in MSWindows (STR
 	  #1601)

Modified: branches/branch-1.1/src/fl_color.cxx
===================================================================
--- branches/branch-1.1/src/fl_color.cxx	2007-03-20 09:42:36 UTC (rev 5747)
+++ branches/branch-1.1/src/fl_color.cxx	2007-03-20 09:52:51 UTC (rev 5748)
@@ -374,12 +374,12 @@
   else c2 = fl_cmap[bg];
 
   // Compute the luminosity...
-  l1 = ((c1 >> 24) * 31 + ((c1 >> 16) & 255) * 61 + ((c1 >> 8) & 255) * 8) / 100;
-  l2 = ((c2 >> 24) * 31 + ((c2 >> 16) & 255) * 61 + ((c2 >> 8) & 255) * 8) / 100;
+  l1 = ((c1 >> 24) * 30 + ((c1 >> 16) & 255) * 59 + ((c1 >> 8) & 255) * 11) / 100;
+  l2 = ((c2 >> 24) * 30 + ((c2 >> 16) & 255) * 59 + ((c2 >> 8) & 255) * 11) / 100;
 
   // Compare and return the contrasting color...
-  if ((l1 - l2) > 90) return fg;
-  else if ((l2 - l1) > 90) return fg;
+  if ((l1 - l2) > 96) return fg;
+  else if ((l2 - l1) > 96) return fg;
   else if (l2 > 127) return FL_BLACK;
   else return FL_WHITE;
 }

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.