fix a bug with color generation in the js