+(defun color-clamp (value)
+ "Make sure VALUE is a number between 0.0 and 1.0 inclusive."
+ (min 1.0 (max 0.0 value)))
+
+(defun color-saturate-hsl (H S L percent)
+ "Make a color more saturated by a specified amount.
+Given a color defined in terms of hue, saturation, and luminance
+\(arguments H, S, and L), return a color that is PERCENT more
+saturated. Returns a list (HUE SATURATION LUMINANCE)."
+ (list H (color-clamp (+ S (/ percent 100.0))) L))
+
+(defun color-saturate-name (name percent)
+ "Make a color with a specified NAME more saturated by PERCENT.
+See `color-saturate-hsl'."
+ (apply 'color-rgb-to-hex
+ (apply 'color-hsl-to-rgb
+ (apply 'color-saturate-hsl
+ (append
+ (apply 'color-rgb-to-hsl
+ (color-name-to-rgb name))
+ (list percent))))))
+
+(defun color-desaturate-hsl (H S L percent)
+ "Make a color less saturated by a specified amount.
+Given a color defined in terms of hue, saturation, and luminance
+\(arguments H, S, and L), return a color that is PERCENT less
+saturated. Returns a list (HUE SATURATION LUMINANCE)."
+ (color-saturate-hsl H S L (- percent)))
+
+(defun color-desaturate-name (name percent)
+ "Make a color with a specified NAME less saturated by PERCENT.
+See `color-desaturate-hsl'."
+ (color-saturate-name name (- percent)))
+
+(defun color-lighten-hsl (H S L percent)
+ "Make a color lighter by a specified amount.
+Given a color defined in terms of hue, saturation, and luminance
+\(arguments H, S, and L), return a color that is PERCENT lighter.
+Returns a list (HUE SATURATION LUMINANCE)."
+ (list H S (color-clamp (+ L (/ percent 100.0)))))
+
+(defun color-lighten-name (name percent)
+ "Make a color with a specified NAME lighter by PERCENT.
+See `color-lighten-hsl'."
+ (apply 'color-rgb-to-hex
+ (apply 'color-hsl-to-rgb
+ (apply 'color-lighten-hsl
+ (append
+ (apply 'color-rgb-to-hsl
+ (color-name-to-rgb name))
+ (list percent))))))
+
+(defun color-darken-hsl (H S L percent)
+ "Make a color darker by a specified amount.
+Given a color defined in terms of hue, saturation, and luminance
+\(arguments H, S, and L), return a color that is PERCENT darker.
+Returns a list (HUE SATURATION LUMINANCE)."
+ (color-lighten-hsl H S L (- percent)))
+
+(defun color-darken-name (name percent)
+ "Make a color with a specified NAME darker by PERCENT.
+See `color-darken-hsl'."
+ (color-lighten-name name (- percent)))
+