In the 18th Century White Piano Keys were black !
When the Piano became the principal keyboard instrument in the 19th century the black and white keys were switched to the current day setup.
The seven natural notes of each octave are the white keys. The five semitones are the black keys.
Older pianos dating from the 18th century the key colors were reversed! White keys were black and the black keys were white.
In fact all keyboard instruments such as the harpsichord and organs had the opposite of the white and black key arrangement.