public function getSaturation($colorMode = self::HSL) {
		$r = (($this->rgb >> 16) & 0xff) / 255;
		$g = (($this->rgb >> 8) & 0xff) / 255;
		$b = ($this->rgb & 0xff) / 255;
		$max = max($r, $g, $b);
		$min = min($r, $g, $b);
		if($max === 0) {
			return 0;
		}
		if($colorMode === self::HSL) {
			$diff = $max - $min;
			//$luminance = ($max + $min) / 2;
			if($diff < 0.5) {
				return $diff / ($max + $min);
			} else {
				return $diff / (2 - $max - $min);
			}
		} else if($colorMode === self::HSV) {
			return ($max - $min) / $max;
		} else if($colorMode === self::HSI) {
			if($max - $min === 0) {
				return 0;
			} else {
				return 1 - $min / (($r + $g + $b) / 3);
			}
		}

		throw new Exception('Unknown color mode');
	}