Contrastive loss for single channel

can we calculate contrastive loss for single channel, like for rgb color space can we calculate contrastive loss for r_band?