ok after running into this problem none of the solutions above worked for me.
but the following worked for me.
The illustrator document i was working was on cmyk mode and changing to RBG didn’t solve. I copied the HEX value and deleted all the colours from the appearance sub-menu which can be found under window. I copied the (colourless) shapes into new RGB file and gave them HEX values and done!
This happened with a logo with only 2 colours so it was easy to change the HEX values.