Code example for ForegroundColorSpan

0
    return appendWithStyle(new ForegroundColorSpan(context.getResources().getColor(R.color.blue)), text);
  } 
 
  public StyleableSpannableStringBuilder appendLightGray(CharSequence text) {
//    Log.d(TAG, "appendBlue: " + text); 
    return appendWithStyle(new ForegroundColorSpan(Color.LTGRAY), text);
  } 
 
  public StyleableSpannableStringBuilder appendGray(CharSequence text) {
//    Log.d(TAG, "appendBlue: " + text); 
    if (text != null) {
      return appendWithStyle(new ForegroundColorSpan(Color.GRAY), text);
    } 
    return null; 
  } 
}