code: def ColorLuminance(color):
    
    r = int(color[0:2], 16)
    g = int(color[2:4], 16)
    b = int(color[4:6], 16)
    return (299*r + 587*g + 114*b) / 1000.0
docs: Compute the brightness of an sRGB color using the formula from
    http://www.w3.org/TR/2000/WD-AERT-20000426#color-contrast.
  
    Args:
      color: a string of 6 hex digits in the format verified by IsValidHexColor().
  
    Returns:
      A floating-point number between 0.0 (black) and 255.0 (white).