parameters: (element, name, *args)
docstring: value = get_color_attrib(element, name, default)
  
      Returns a 3-digit or 6-digit hex RGB string in CSS format (e.g., '#123'
      or '#1a2b3c'), or the (optional) default value. If the default value is
      not provided and the attribute is missing then an exception is thrown. If
      the attribute is not a valid RGB string then it will be checked against various
      named colours.  If the attribute is still not valid an exception is thrown.
docstring_summary: value = get_color_attrib(element, name, default)
docstring_tokens: value = get_color_attrib ( element name default )
function: def get_color_attrib(element, name, *args):
      """value = get_color_attrib(element, name, default)
  
      Returns a 3-digit or 6-digit hex RGB string in CSS format (e.g., '#123'
      or '#1a2b3c'), or the (optional) default value. If the default value is
      not provided and the attribute is missing then an exception is thrown. If
      the attribute is not a valid RGB string then it will be checked against various
      named colours.  If the attribute is still not valid an exception is thrown.
      """
      (val, is_default) = _get_attrib(element, name, *args)
      if is_default:
          named_color = colors.get_css_color(val)
          if named_color is not None:
              return named_color
          else:
              return val
  
      match = re.search(r'^#(?:[0-9a-fA-F]{1,2}){3}$', val)
      if match:
          return val
      else:
          named_color = colors.get_css_color(val)
          if named_color is not None:
              return named_color
          else:
              raise Exception('Attribute "{:s}" must be a CSS-style RGB string: {:s}'.format(name, val))
function_tokens: def get_color_attrib ( element , name , * args ) : ( val , is_default ) = _get_attrib ( element , name , * args ) if is_default : named_color = colors . get_css_color ( val ) if named_color is not None : return named_color else : return val match = re . search ( r'^#(?:[0-9a-fA-F]{1,2}){3}$' , val ) if match : return val else : named_color = colors . get_css_color ( val ) if named_color is not None : return named_color else : raise Exception ( 'Attribute "{:s}" must be a CSS-style RGB string: {:s}' . format ( name , val ) )