For correcting contrast in RGB we must apply function
y = (x - min)*255/(max-min)
for each channel R, G and B
In YCbCr it is applied to the Y only
How should it work with HSL and HSV?
Maybe we should apply it to some combination of Saturation and Value (Luminance)?