Cleaned up extract_rgb_values