code: def rgb_to_hsl(r, g, b):
      """Convert a color in r, g, b to a color in h, s, l"""
      r = r or 0
      g = g or 0
      b = b or 0
      r /= 255
      g /= 255
      b /= 255
      max_ = max((r, g, b))
      min_ = min((r, g, b))
      d = max_ - min_
  
      if not d:
          h = 0
      elif r is max_:
          h = 60 * (g - b) / d
      elif g is max_:
          h = 60 * (b - r) / d + 120
      else:
          h = 60 * (r - g) / d + 240
  
      l = 0.5 * (max_ + min_)
      if not d:
          s = 0
      elif l < 0.5:
          s = 0.5 * d / l
      else:
          s = 0.5 * d / (1 - l)
      return tuple(map(normalize_float, (h % 360, s * 100, l * 100)))
  
file_path: pygal/pygal/colors.py
imports: from __future__ import division
label_desc: Use image node_id 2 for calling a global function with example usage: rgb_to_hsl(r, g, b) and returns: tuple