code: def __init__(self, content):
      color = content.strip()
      if color.startswith("#"):
          rgb = color[1:]
          if len(rgb) == 3:
              r, g, b = tuple(ord((c + c).decode("hex")) for c in rgb)
          else:
              # r,g,b = tuple(ord(c) for c in rgb.decode('hex'))
              r, g, b = tuple(c for c in _rgb(rgb))
      elif color.startswith("rgb("):
          rgb = color[4:-1]
          r, g, b = [value.strip() for value in rgb.split(",")]
          if r.endswith("%"):
              r = 255 * int(r[:-1]) // 100
          else:
              r = int(r)
          if g.endswith("%"):
              g = 255 * int(g[:-1]) // 100
          else:
              g = int(r)
          if b.endswith("%"):
              b = 255 * int(b[:-1]) // 100
          else:
              b = int(r)
      elif color in _keyword_colors:
          r, g, b = _keyword_colors[color]
      else:
          # text = "Unknown color (%s)" % color
          r, g, b = 0, 0, 0
      self._rgb = r / 255.0, g / 255.0, b / 255.0
  
file_path: vispy/vispy/util/svg/color.py
imports: from itertools import product
  from string import hexdigits
label_desc: Use image node_id 1 to create a new Color object from inherited base classes: object with example: obj = Color(content)