#4240 NORM Future : White font color in chat hard to read when yellow buddy color

Zarro Boogs per Child bugtracker at laptop.org
Fri Dec 21 08:00:12 EST 2007


#4240: White font color in chat hard to read when yellow buddy color
-------------------------------+--------------------------------------------
  Reporter:  erikos            |       Owner:  Eben          
      Type:  defect            |      Status:  new           
  Priority:  normal            |   Milestone:  Future Release
 Component:  interface-design  |     Version:                
Resolution:                    |    Keywords:                
  Verified:  0                 |  
-------------------------------+--------------------------------------------

Comment(by humptybump):

 here is some pseudo code I wrote based on the w3c draft recommendations
 for colors ...

 #Two colors provide good color visibility if the brightness difference and
 the color difference between the two colors are greater than a set range.
 #The range for color brightness difference is 125. The range for color
 difference is 500.

 define MIN_COLOR_BRIGHT = 125
 define MIN_COLOR_DIFF = 400    # w3c recommends 500 while HP uses 400
 which tests show is sufficient


 # initially assume white text
 C2Red = C2Grn = C2Blu = 0xFF

 #Color brightness is determined by the following formula:
 #Note: This algorithm is taken from a formula for converting RGB values to
 YIQ values. This brightness value gives a perceived brightness for a
 color.

 colorBright = ABS ((((C1Red X 299) + (C1Grn X 587) + (C1Blu X 114)) /
 1000) -
                    (((C2Red X 299) + (C2Grn X 587) + (C2Blu X 114)) /
 1000))


 Color difference is determined by the following formula:

 colorDiff = (MAX (C1Red, C2Red) - MIN (C1Red, C2Red)) +
             (MAX (C1Grn, C2Grn) - MIN (C1Grn, C2Grn)) +
             (MAX (C1Blu, C2Blu) - MIN (C1Blu, C2Blu))


 if ((colorBright < MIN_COLOR_BRIGHT) || (colorDiff < MIN_COLOR_DIFF)) {
     # white text does not have enough contrast. switch to black
     C2Red = C2Grn = C2Blu = 0x00
 }

-- 
Ticket URL: <http://dev.laptop.org/ticket/4240#comment:4>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list