Code example for BackgroundColorSpan

0
     * @param text 
     * @param color 
     * @return this text 
     */ 
    public StyledText background(final CharSequence text, final int color) {
        return append(text, new BackgroundColorSpan(color));
    } 
 
    /** 
     * Append text in with custom foreground color 
     * 
     * @param text 
     * @param color 
     * @return this text 
     */ 
    public StyledText foreground(final CharSequence text, final int color) {
        return append(text, new ForegroundColorSpan(color));
    } 
 
    /** 
Contextual code suggestions in your IDE  Get Codota for Java