Herein lies a misunderstanding: "...that is done separately for each band and not for a specific colour."
"Each band" and "specific colour" are in fact the same thing. That is, it is the values in each band that, when combined together, make a specific colour. For example the RGB triplet
255,0,0 is the specific colour of pure red, comprised of band-red at the top of the range, 255, and band-green at the bottom, 0, ditto for band-blue.
Here's a simple gdal python script to change the nodata values for a specific image with 3 channels, a.k.a RGB:
from osgeo import gdal
input = 'd:/gisdata/test.tif'
dataset = gdal.Open(input, gdal.GA_Update) # open the raster for writing
# 1 corresponds to Red channel, 2 for Green, 3 for Blue
R = dataset.GetRasterBand(1)
G = dataset.GetRasterBand(2)
B = dataset.GetRasterBand(3)
print 'Initial nodata values (RGB):\t', R.GetNoDataValue(), G.GetNoDataValue(), B.GetNoDataValue()
# set null value to the background page colour used on GIS.se, change as desired
print 'New nodata values (RGB):\t', R.GetNoDataValue(), G.GetNoDataValue(), B.GetNoDataValue()
Initial nodata values (RGB): None None None
New nodata values (RGB): 251.0 250.0 247.0
A more generalized script that can handle arbitrary numbers of bands and used as a commandline utility can be found my code swamp, as gdalsetnull.py