Setting different colors based on value when labeling using QGIS

If you right-click your layer and go to:

Properties > Labels

Use the Show labels for this layer option, select the field to label with and then click the data-defined button for the Color section as shown below:

Properties for labels

Then enter an expression like:

CASE 
  WHEN "Field" = 10 THEN color_rgb(0, 0, 255) 
  WHEN "Field" = 15 THEN color_rgb(0, 255, 0)
  WHEN "Field" = 25 THEN color_rgb(255, 0, 0)
  ELSE color_rgb(0, 0, 0)
END

or

CASE
  WHEN "Field" = 10 THEN '#0000ff'
  WHEN "Field" = 15 THEN '#00ff00'
  WHEN "Field" = 25 THEN '#ff0000'
  ELSE '#000000'
END

Click Apply then OK and hopefully you should see your labels with different colours:

Result


Tested on QGIS 2.16.1-Nødebo.


If you want to change any more than the color your best bet would be Rule based labeling, though for a single value you are better off using expressions for that specific value as already mentioned.

Rule based labelling screen

From memory this method has also been around for longer than expressions in data definitions and so should work further back in versions. Though someone please correct me if my memory is off there.