Use cycles shader only on painted area?

Is is possible to apply a group shader only on the painted area, leaving the rest as diffuse color?

Use the painted texture as the factor in a mix shader
black = 0 = 100% top input of mix shader
while = 1 = 100% bottom input of mix shader