Improve algorithm (returned colors are rgb instead hex colors) and add rgbToHex method.