class_docstr: Trait representing a color that can be passed to Google maps.
  
  This is either a string like 'blue' or '#aabbcc' or an RGB
  tuple like (100, 0, 250) or an RGBA tuple like (100, 0, 250, 0.5).
class_docstr_tok: ["Trait","representing","a","color","that","can","be","passed","to","Google","maps",".","This","is","either","a","string","like","'blue","'","or","'","#","aabbcc","'","or","an","RGB","tuple","like","(","100",",","0",",","250",")","or","an","RGBA","tuple","like","(","100",",","0",",","250",",","0.5",")","."]
docstr: Verifies that 'value' is a string or tuple and converts it to a
  value like 'rgb(x,y,z)'
docstr_tok: ["Verifies","that","'value","'","is","a","string","or","tuple","and","converts","it","to","a","value","like","'rgb","(","x",",","y",",","z",")","'"]
code: def validate(self, obj, value):
      """
      Verifies that 'value' is a string or tuple and converts it to a
      value like 'rgb(x,y,z)'
      """
      value = super(ColorAlpha, self).validate(obj, value)
      if isinstance(value, tuple):
          if len(value) == 3:
              # convert to an rgb string
              return "rgb({},{},{})".format(*value)
          else:
              # convert to an rgba string
              return "rgba({},{},{},{})".format(*value)
      else:
          # already a string
          return value
  
imports: import re
  import traitlets
  from .locations import locations_to_list
label_desc: Use image node_id 2 for calling the ColorAlpha obj's underlying member method code with example usage: obj.validate(obj, value) and returns: value, str, str