Set contour colors.

@return The current IconicsDrawable for chaining.
552978
@NonNull
    public IconicsDrawable contourColor(@NonNull ColorStateList colors) {
        if (colors != null) {
            mContourBrush.setColors(colors);
            if (mContourBrush.applyState(getState())) {
                invalidateSelf();
            }
        }
        return this;
    }
248369
@NonNull
    public IconicsDrawable roundedCornersRxDp(@Dimension(unit = DP) int sizeDp) {
        return roundedCornersRxPx(Utils.convertDpToPx(mContext, sizeDp));
    }
1218055
public Fingerprint circleErrorColor(int circleError) {
        this.circleError = circleError;
        this.circleView.setBackgroundTintList(ColorStateList.valueOf(getContext().getColor(circleError)));
        return this;
    }
1191020
@Override
    protected IIOMetadataNode getStandardChromaNode() {
        IIOMetadataNode chroma = new IIOMetadataNode("Chroma");

        IIOMetadataNode colorSpaceType = new IIOMetadataNode("ColorSpaceType");
        String cs;
        switch (header.mode) {
            case PSD.COLOR_MODE_BITMAP:
            case PSD.COLOR_MODE_GRAYSCALE:
            case PSD.COLOR_MODE_DUOTONE: // Rationale: Spec says treat as gray...
                cs = "GRAY";
                break;
            case PSD.COLOR_MODE_RGB:
            case PSD.COLOR_MODE_INDEXED:
                cs = "RGB";
                break;
            case PSD.COLOR_MODE_CMYK:
                cs = "CMYK";
                break;
            case PSD.COLOR_MODE_MULTICHANNEL:
                cs = getMultiChannelCS(header.channels);
                break;
            case PSD.COLOR_MODE_LAB:
                cs = "Lab";
                break;
            default:
                throw new AssertionError("Unreachable");
        }
        colorSpaceType.setAttribute("name", cs);
        chroma.appendChild(colorSpaceType);

        // TODO: Channels might be 5 for RGB + A + Mask... Probably not correct
        IIOMetadataNode numChannels = new IIOMetadataNode("NumChannels");
        numChannels.setAttribute("value", Integer.toString(header.channels));
        chroma.appendChild(numChannels);

        IIOMetadataNode blackIsZero = new IIOMetadataNode("BlackIsZero");
        blackIsZero.setAttribute("value", "true");
        chroma.appendChild(blackIsZero);

        if (header.mode == PSD.COLOR_MODE_INDEXED) {
            IIOMetadataNode paletteNode = createPaletteNode();
            chroma.appendChild(paletteNode);
        }

        // TODO: Use
//        if (bKGD_present) {
//            if (bKGD_colorType == PNGImageReader.PNG_COLOR_PALETTE) {
//                node = new IIOMetadataNode("BackgroundIndex");
//                node.setAttribute("value", Integer.toString(bKGD_index));
//            } else {
//                node = new IIOMetadataNode("BackgroundColor");
//                int r, g, b;
//
//                if (bKGD_colorType == PNGImageReader.PNG_COLOR_GRAY) {
//                    r = g = b = bKGD_gray;
//                } else {
//                    r = bKGD_red;
//                    g = bKGD_green;
//                    b = bKGD_blue;
//                }
//                node.setAttribute("red", Integer.toString(r));
//                node.setAttribute("green", Integer.toString(g));
//                node.setAttribute("blue", Integer.toString(b));
//            }
//            chroma_node.appendChild(node);
//        }

        return chroma;
    }
839693
public Paint getLeftShadowGradient(Shape s) {
        Rectangle2D bounds = s.getBounds2D();
        float       minX   = (float) bounds.getMinX();
        float       maxX   = (float) bounds.getMaxX();
        float       midY   = (float) bounds.getCenterY();

        return new LinearGradientPaint(minX, midY, maxX, midY, (new float[] { 0f, 1f }),
                                       new Color[] { innerShadow.bottom, transparentColor });
    }
942641
@NonNull
    public IconicsDrawable backgroundContourColorRes(@ColorRes int colorResId) {
        return backgroundContourColor(ContextCompat.getColor(mContext, colorResId));
    }
598173
public static SymbolVisibility all() {
        return new SymbolVisibility() {

            @Override
            public boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model) {
                return true;
            }
        };
    }
1052337
public Paint getRoundedShadowGradient(Shape s) {
        Rectangle r    = s.getBounds();
        int       x    = r.x + r.width / 2;
        int       y1   = r.y;
        float     frac = 1.0f / r.height;
        int       y2   = r.y + r.height;

        return new LinearGradientPaint(x, y1, x, y2, (new float[] { 0f, frac, 1f }),
                                       new Color[] { innerShadow.top, innerShadow.bottom, innerShadow.bottom });
    }
730315
@Nullable
    public static IconicsDrawable getIconicsImageViewDrawable(@NonNull Context ctx,
                                                              @Nullable AttributeSet attrs) {
        final TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.IconicsImageView);
        try {
            return new IconicsAttrsExtractor(ctx, a)
                    .iconId(R.styleable.IconicsImageView_iiv_icon)
                    .colorsId(R.styleable.IconicsImageView_iiv_color)
                    .sizeId(R.styleable.IconicsImageView_iiv_size)
                    .paddingId(R.styleable.IconicsImageView_iiv_padding)
                    .contourColorId(R.styleable.IconicsImageView_iiv_contour_color)
                    .contourWidthId(R.styleable.IconicsImageView_iiv_contour_width)
                    .backgroundColorId(R.styleable.IconicsImageView_iiv_background_color)
                    .cornerRadiusId(R.styleable.IconicsImageView_iiv_corner_radius)
                    .backgroundContourColorId(R.styleable.IconicsImageView_iiv_background_contour_color)
                    .backgroundContourWidthId(R.styleable.IconicsImageView_iiv_background_contour_width)
                    .shadowRadiusId(R.styleable.IconicsImageView_iiv_shadow_radius)
                    .shadowDxId(R.styleable.IconicsImageView_iiv_shadow_dx)
                    .shadowDyId(R.styleable.IconicsImageView_iiv_shadow_dy)
                    .shadowColorId(R.styleable.IconicsImageView_iiv_shadow_color)
                    .animationsId(R.styleable.IconicsImageView_iiv_animations)
                    .extract();
        } finally {
            a.recycle();
        }
    }
467652
@NonNull
    public IconicsDrawable paddingPx(@Dimension(unit = PX) int sizePx) {
        if (mIconPadding != sizePx) {
            mIconPadding = sizePx;
            if (mDrawContour) {
                mIconPadding += mContourWidth;
            }
            if (mDrawBackgroundContour) {
                mIconPadding += mBackgroundContourWidth;
            }

            invalidateSelf();
        }
        return this;
    }
814056
public static void applyMultiIconTo(Drawable icon, int iconColor, Drawable selectedIcon, int selectedIconColor, boolean tinted, ImageView imageView) {
        //if we have an icon then we want to set it
        if (icon != null) {
            //if we got a different color for the selectedIcon we need a StateList
            if (selectedIcon != null) {
                if (tinted) {
                    imageView.setImageDrawable(new PressedEffectStateListDrawable(icon, selectedIcon, iconColor, selectedIconColor));
                } else {
                    imageView.setImageDrawable(UIUtils.getIconStateList(icon, selectedIcon));
                }
            } else if (tinted) {
                imageView.setImageDrawable(new PressedEffectStateListDrawable(icon, iconColor, selectedIconColor));
            } else {
                imageView.setImageDrawable(icon);
            }
            //make sure we display the icon
            imageView.setVisibility(View.VISIBLE);
        } else {
            //hide the icon
            imageView.setVisibility(View.GONE);
        }
    }
940588
public Drawable decideIcon(Context ctx, int iconColor, boolean tint, int paddingDp) {
        Drawable icon = getIcon();

        if (mIIcon != null) {
            icon = new IconicsDrawable(ctx, mIIcon).color(iconColor).sizeDp(24).paddingDp(paddingDp);
        } else if (getIconRes() != -1) {
            icon = AppCompatResources.getDrawable(ctx, getIconRes());
        } else if (getUri() != null) {
            try {
                InputStream inputStream = ctx.getContentResolver().openInputStream(getUri());
                icon = Drawable.createFromStream(inputStream, getUri().toString());
            } catch (FileNotFoundException e) {
                //no need to handle this
            }
        }

        //if we got an icon AND we have auto tinting enabled AND it is no IIcon, tint it ;)
        if (icon != null && tint && mIIcon == null) {
            icon = icon.mutate();
            icon.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
        }

        return icon;
    }
1339036
@NonNull
    public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
        return backgroundColor(ContextCompat.getColor(mContext, colorResId));
    }
1196353
void setDrawable(@Nullable IconicsAnimatedDrawable drawable) {
        mDrawable = null;
        onDrawableDetached();

        if (drawable != null) {
            mDrawable = drawable;
            onDrawableAttached();

            if (mIsStartImmediately || mIsStartRequested) {
                start();
            }
        } else {
            mAnimator.cancel();
        }
    }
1134792
public JFreeChartRender setGridPaint(Color color) {
        getPlot().setRangeGridlinePaint(color);
        getPlot().setDomainGridlinePaint(color);
        return this;
    }
420878
@NonNull
    public IconicsAnimationProcessor start() {
        mAnimator.setInterpolator(mInterpolator);
        mAnimator.setDuration(mDuration);
        mAnimator.setRepeatCount(mRepeatCount);
        mAnimator.setRepeatMode(mRepeatMode);

        if (mDrawable != null) {
            mIsStartRequested = false;
            mAnimator.start();
        } else {
            mIsStartRequested = true;
        }
        return this;
    }
251923
def setColorSet( self, colorSet ):
        
        self._colorSet = colorSet
        
        if ( not colorSet ):
            return
        
        palette = self.palette()
        palette.setColor( palette.Base, colorSet.color('Background'))
        self.setPalette(palette)
        
        # set the global colors
        self.setCaretForegroundColor(
                                colorSet.color('CaretForeground'))
        self.setMarginsBackgroundColor(
                                colorSet.color('MarginsBackground'))
        self.setMarginsForegroundColor(
                                colorSet.color('MarginsForeground'))
        self.setPaper(          colorSet.color('Background'))
        self.setSelectionBackgroundColor(
                                colorSet.color('SelectionBackground'))
        self.setSelectionForegroundColor(
                                colorSet.color('SelectionForeground'))
        self.setFoldMarginColors(colorSet.color('FoldMarginsForeground'),
                                 colorSet.color('FoldMarginsBackground'))
        self.setCallTipsBackgroundColor(
                                colorSet.color('CallTipsBackground'))
        self.setCallTipsForegroundColor(
                                colorSet.color('CallTipsForeground'))
        self.setCallTipsHighlightColor(
                                colorSet.color('CallTipsHighlight'))
        self.setEdgeColor(      colorSet.color('Edge'))
        self.setMarkerBackgroundColor(
                                colorSet.color('MarkerBackground'))
        self.setMarkerForegroundColor(
                                colorSet.color('MarkerForeground'))
        self.setMatchedBraceBackgroundColor(
                                colorSet.color('MatchedBraceBackground'))
        self.setMatchedBraceForegroundColor(
                                colorSet.color('MatchedBraceForeground'))
        self.setUnmatchedBraceBackgroundColor(
                                colorSet.color('UnmatchedBraceBackground'))
        self.setUnmatchedBraceForegroundColor(
                                colorSet.color('UnmatchedBraceForeground'))
        self.setColor(          colorSet.color('Text'))
        
        self.setIndentationGuidesBackgroundColor(
                                    colorSet.color('IndentBackground'))
        self.setIndentationGuidesForegroundColor(
                                colorSet.color('IndentForeground'))
        
        # backwards support
        if ( hasattr(self, 'setCaretBackgroundColor') ):
            self.setCaretBackgroundColor(
                                    colorSet.color('CaretBackground'))
        elif ( hasattr(self, 'setCaretLineBackgroundColor') ):
            self.setCaretLineBackgroundColor(
                                    colorSet.color('CaretBackground'))
                                    
        
        # supported in newer QScintilla versions
        if ( hasattr(self, 'setIndicatorForegroundColor') ):
            self.setIndicatorForegroundColor(
                                    colorSet.color('IndicatorForeground'))
            self.setIndicatorOutlineColor(
                                    colorSet.color('IndicatorOutline'))
        
        # set the language and lexer colors
        lang  = self.language()
        lexer = self.lexer()
        
        if ( lang and lexer ):
            lang.setColorSet(lexer, colorSet)