code: def colorize(text, color, background=False):
      
  
      if color in _styles:
          c = Color(text)
          c.styles = [_styles.index(color) + 1]
          return c
  
      c = Color(text)
      if background:
          c.bgcolor = _color2ansi(color)
      else:
          c.fgcolor = _color2ansi(color)
      return c
docs: Colorize text with hex code.
  
      :param text: the text you want to paint
      :param color: a hex color or rgb color
      :param background: decide to colorize background
  
      ::
  
          colorize('hello', 'ff0000')
          colorize('hello', '#ff0000')
          colorize('hello', (255, 0, 0))