docs: def _text_to_rgb(value,norm=False,cat=1, tot=1,offset=0.5,hex=False):
      '''
      _text_to_rgb takes as input a string composed by 3 values in the range [0,255]
      and returns a tuple of integers. If the parameters cat and tot are given,
      the function generates a transparency value for this color and returns a tuple
      of length 4.
      tot is the total number of colors in the colormap
      cat is the index of the current colour in the colormap
      if norm is set to True, the input values are normalized between 0 and 1.
      '''
      tokens = value.split()
      if hex:
              for i in range(len(tokens)):
                  tokens[i] = _hex_to_rgb(tokens[i]) 
      transparency = float(cat)/float(tot)+offset
      if transparency > 1.0:
          transparency = 1.0
      if norm:
          return (float(tokens[0])/255.0, float(tokens[1])/255.0, float(tokens[2])/255.0, transparency)
      else:    
          return (int(tokens[0]), int(tokens[1]), int(tokens[2]), int(round(transparency * 255.0)))