Looking to create a CTL with a colour transform that is de-saturates a pair of opposing colours.
My example below works: but not as expected:
__DEVICE__ float3 squeeze_GM(float percentage, float R, float G, float B) {
float rOut = R - (((percentage/2) / 100) * R);
float gOut = G - ((percentage / 100) * G);
float bOut = B - (((percentage/2) / 100) * B);
return make_float3(rOut, gOut, bOut);
}
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B){
float3 result = squeeze_GM(15, p_R, p_G, p_B);
return result;
}
I would like to squeeze the green and magenta, so as to de-saturate these colours by a certain percentage passed to the squeeze_GM function.
Does anyone have any details how I might get this transform? At the moment I think I am just making the RGB values darker by a certain percentage. Would I need to average my R and B results?
Look at Wiki for HUE
An idea could be: