Sets a background to the drawer profile

@param background Background to set
481736
public DrawerProfile setBackground(Context context, Bitmap background) {
        mBackground = new BitmapDrawable(context.getResources(), background);
        notifyDataChanged();
        return this;
    }
182732
@SuppressWarnings("deprecation")
    @SuppressLint("NewApi")
    public void setBackgroundCompat(Drawable drawable) {
        int pL = getPaddingLeft();
        int pT = getPaddingTop();
        int pR = getPaddingRight();
        int pB = getPaddingBottom();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            setBackground(drawable);
        } else {
            setBackgroundDrawable(drawable);
        }
        setPadding(pL, pT, pR, pB);
    }
174838
public final void setDialogHeaderBackground(@Nullable final Bitmap background) {
        this.dialogHeaderBackground = new BitmapDrawable(getContext().getResources(), background);
        this.dialogHeaderBackgroundBitmap = background;
        this.dialogHeaderBackgroundId = -1;
        this.dialogHeaderBackgroundColor = -1;
    }
318970
public void setBackgroundColor(int colorRes) {
        if (getBackground() instanceof ShapeDrawable) {
            final Resources res = getResources();
            ((ShapeDrawable) getBackground()).getPaint().setColor(res.getColor(colorRes));
        }
    }
836175
private void paintBackgroundCap(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createScrollCap(0, 0, width, height);

        dropShadow.fill(g, s);
        fillScrollBarButtonInteriorColors(g, s, isIncrease, buttonsTogether);
    }
683172
public void setBackgroundColor(ColorStateList colorStateList) {
        if (colorStateList != null && mBackgroundColor != colorStateList) {
            mBackgroundColor = colorStateList;
            setBackgroundColor(mBackgroundColor.getColorForState(getDrawableState(), mBackgroundColor.getDefaultColor()));
        }
    }
1042671
def set_palette(self, background, foreground):
        
        palette = QPalette()
        palette.setColor(QPalette.Base, background)
        palette.setColor(QPalette.Text, foreground)
        self.setPalette(palette)

        # Set the right background color when changing color schemes
        # or creating new Editor windows. This seems to be a Qt bug.
        # Fixes Issue 2028 and 8069
        if self.objectName():
            style = "QPlainTextEdit#%s {background: %s; color: %s;}" % \
                    (self.objectName(), background.name(), foreground.name())
            self.setStyleSheet(style)
896428
public static void setBackground(View v, @DrawableRes int drawableRes) {
        ViewCompat.setBackground(v, ContextCompat.getDrawable(v.getContext(), drawableRes));
    }
920287
public void setBackgroundColorRes(int colorRes) {
        ColorStateList colorStateList = UiCompat.getColorStateList(getResources(), colorRes);
        if (colorStateList == null)
            setBackgroundColor(0);
        else
            setBackgroundColor(colorStateList.getDefaultColor());
    }
1161705
public final void setCheckedStateBackgroundColor(@ColorInt int backgroundColor) {
        if ((backgroundColor != mCheckedBackgroundColor) &&
            (null != mCheckedBackgroundPaint)) {
            mCheckedBackgroundPaint.setColor(backgroundColor);
            if (isChecked()) {
                invalidate();
            }
        }

        mCheckedBackgroundColor = backgroundColor;
    }
270595
public void startBackgroundIconColorFadeAnimation(final int cycleCount) {
        if (backgroundIcon == null) {
            LOGGER.warn("Background animation skipped because background icon not set!");
            return;
        }
        backgroundIconColorFadeAnimation = Animations.createFadeTransition(backgroundIcon, JFXConstants.TRANSPARENCY_FULLY, JFXConstants.TRANSPARENCY_NONE, cycleCount, JFXConstants.ANIMATION_DURATION_FADE_SLOW);
        backgroundIconColorFadeAnimation.setOnFinished(event -> backgroundIcon.setOpacity(JFXConstants.TRANSPARENCY_FULLY));
        backgroundIconColorFadeAnimation.play();
    }
213485
public void applyToBackground(View view) {
        if (mColorInt != 0) {
            view.setBackgroundColor(mColorInt);
        } else if (mColorRes != -1) {
            view.setBackgroundResource(mColorRes);
        }
    }
1227837
public final void setDialogBackground(@Nullable final Bitmap background) {
        this.dialogBackground = new BitmapDrawable(getContext().getResources(), background);
        this.dialogBackgroundBitmap = background;
        this.dialogBackgroundId = -1;
        this.dialogBackgroundColor = -1;
    }
360766
public final void setDialogBackground(@DrawableRes final int resourceId) {
        this.dialogBackground = ContextCompat.getDrawable(getContext(), resourceId);
        this.dialogBackgroundBitmap = null;
        this.dialogBackgroundId = resourceId;
        this.dialogBackgroundColor = -1;
    }
881434
def _set_widget_background_color(widget, color):
        
        pal = widget.palette()
        pal.setColor(pal.Base, color)
        widget.setPalette(pal)
998437
def setBackground(self, column, brush):
        
        if brush:
            self._background[column] = QtGui.QBrush(brush)
        elif column in self._background:
            self._background.pop(column)
577729
protected void drawForegroundToBackground() {
        if (backgroundColor == null) { return; }

        final BufferedImage backgroundBufferedImage = new BufferedImage(dimension.width, dimension.height, this.bufferedImage.getType());
        final Graphics graphics = backgroundBufferedImage.getGraphics();

        // draw current color
        graphics.setColor(backgroundColor);
        graphics.fillRect(0, 0, dimension.width, dimension.height);
        graphics.drawImage(bufferedImage, 0, 0, null);

        // draw back to original
        final Graphics graphics2 = bufferedImage.getGraphics();
        graphics2.drawImage(backgroundBufferedImage, 0, 0, null);
    }