Calculates the contrast between two colors using the specified algorithm.
This function provides a unified interface to access multiple contrast calculation
algorithms. It automatically converts the input colors to the appropriate color space
required by each algorithm.
Usage examples:
// Calculate contrast using the default APCA algorithm constapcaContrast = contrast('#000000', '#FFFFFF');
Calculates the contrast between two colors using the specified algorithm.
This function provides a unified interface to access multiple contrast calculation algorithms. It automatically converts the input colors to the appropriate color space required by each algorithm.
Usage examples:
Note that each algorithm produces values in different ranges and with different interpretations: