Added guessing of index from rgb.