I’d agree with you if it wasn’t that the Germans had surrendered before the Atomic Bomb was even completely ready. And even then they didn’t really know what would happen with the Atomic Bomb.
Date of German surrender: May 7th, 1945
Date of Japanese surrender: September 2nd, 1945
Date of the drop of the Atomic Bomb: August 6th, 1945
Racism was not the reason behind the atom bomb. Japan could have surrendered after there was a threat of massive force (the atom bomb). It wasn't like the US just dropped the bomb without warning and that Japan was already preparing to surrender.
The atomic bomb was already in development to be used against Germany. They had to switch gears when Germany surrendered.