Hi

go to edit >preferences > customise keys

in the dropdown box for 'shortcuts' select 'other'

click on 'swap colors' in the 'application commands list'

enter the keystroke you want to use - there will be a message at the bottom if this is already in use

[in my painter IX there appears to be a bug whereby the default keystroke for swap colors is set to shift+s but this does not work because it is also used for save - however changing it to an unused keystroke [eg shift+k] does work]