public static Color applyFunctions( Color color, ColorFunction... functions ) {
		// if having only a single function of type Mix, then avoid four unnecessary conversions:
		//     1. RGB to HSL in this method
		//     2. HSL to RGB in Mix.apply()
		//        mix
		//     3. RGB to HSL in Mix.apply()
		//     4. HSL to RGB in this method
		if( functions.length == 1 && functions[0] instanceof Mix ) {
			Mix mixFunction = (Mix) functions[0];
			return mix( color, mixFunction.color2, mixFunction.weight / 100 );
		} else if( functions.length == 1 && functions[0] instanceof Mix2 ) {
			Mix2 mixFunction = (Mix2) functions[0];
			return mix( mixFunction.color1, color, mixFunction.weight / 100 );
		}

		// convert RGB to HSL
		float[] hsl = HSLColor.fromRGB( color );
		float alpha = color.getAlpha() / 255f;
		float[] hsla = { hsl[0], hsl[1], hsl[2], alpha * 100 };

		// apply color functions
		for( ColorFunction function : functions )
			function.apply( hsla );

		// convert HSL to RGB
		return HSLColor.toRGB( hsla[0], hsla[1], hsla[2], hsla[3] / 100 );
	}
Applies the given color functions to the given color and returns the new color.
flatlaf-core/src/main/java/com/formdev/flatlaf/util/ColorFunctions.java