1) In the Channels dialog, you deselect Red and Green (but you can keep them visible), then only the B component of whatever you do will do something to the layer:
Above, brush stroke on a gray background using white, since only the Blue channel is selected, the Red and Green components are unchanged and the line is light blue: initially (128,128,128) painted over in (255,255,255), becomes (128,128,255).
2) You use a Layer Mask. The layer mask is just the Alpha Channel (or something which is composed with it).
Above, brush stroke on a gray background using white, since only the Blue channel is selected, the Red and Green components are unchanged and the line is light blue: initially (128,128,128) painted over in (255,255,255), becomes (128,128,255).
2) You use a Layer Mask. The layer mask is just the Alpha Channel (or something which is composed with it).