temp color algorithm