I don't get your logic but you can do this :
color = color.replace(/[\d\.]+\)$/g, 'A)')
What it matches :
[\d\.]+
: a combination of.
and digits\)
: the end parenthesis$
: the end of the string (you can remove it if you don't want to ensure it's the end of the string)