Implementation of HSVGen Algorithm