new functions for color detection