add hsi function
use new hsi function in rainbow