Creates the foreground behind which the particles can hide in case of pull to refresh.
346516
function _createForeground(node) {
        this._foreground = {
            surface: new Surface({
                size: this.options.size,
                properties: {
                    backgroundColor: this.options.pullToRefreshBackgroundColor
                }
            }),
            mod: new Modifier({})
        };
        node.add(this._foreground.mod).add(this._foreground.surface);
    }
464943
private static GradientDrawable getKitkatBackground(int color) {
        final GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setCornerRadius(BackgroundUtils.convertToDIP(24));
        gradientDrawable.setColor(color);
        return gradientDrawable;
    }
667539
def foreground(color, content, readline=False):
    
    return encode(color, readline=readline) + content + encode(DEFAULT, readline=readline)
1039810
def background(self):
        """"""
        if self._background is None:
            self._background = GSBackgroundLayer()
            self._background._foreground = self
        return self._background
1261477
private void setHeaderBackground(int colorResId, int drawableResId) {
        if (drawableResId == -1) {
            try {
                header.setBackgroundColor(getResources().getColor(colorResId));
            } catch (Resources.NotFoundException e) {
                e.printStackTrace();
            }
        } else {
            try {
                header.setBackgroundDrawable(getResources().getDrawable(drawableResId));
            } catch (Resources.NotFoundException e) {
                e.printStackTrace();
            }
        }

    }
582144
private void obtainPreviewBackground(@NonNull final TypedArray typedArray) {
        int backgroundColor = typedArray
                .getColor(R.styleable.AbstractColorPickerPreference_previewBackground, -1);

        if (backgroundColor != -1) {
            setPreviewBackgroundColor(backgroundColor);
        } else {
            int resourceId = typedArray
                    .getResourceId(R.styleable.AbstractColorPickerPreference_previewBackground,
                            R.drawable.color_picker_default_preview_background);
            setPreviewBackground(ContextCompat.getDrawable(getContext(), resourceId));
        }
    }
1242345
def background(self):
        
        noFill = self._xPr.get_or_change_to_noFill()
        self._fill = _NoFill(noFill)
859629
def foreground(self, quad=None):
        ''''''
        fg = np.zeros(shape=self._newBorders[::-1], dtype=np.uint8)
        if quad is None:
            quad = self.quad
        else:
            quad = quad.astype(np.int32)
        cv2.fillConvexPoly(fg, quad, 1)
        return fg.astype(bool)
475566
void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
        context.getPainter().paintTextFieldBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
        // If necessary, paint the placeholder text.
        if (placeholderText != null && ((JTextComponent) c).getText().length() == 0 && !c.hasFocus()) {
            paintPlaceholderText(context, g, c);
        }
    }
1368500
private void redraw() {
        double width  = getWidth() - getInsets().getLeft() - getInsets().getRight();
        double height = getHeight() - getInsets().getTop() - getInsets().getBottom();
        size          = width < height ? width : height;

        if (size > 0) {
            if (getWidth() > getHeight()) {
                setTranslateX(0.5 * (getWidth() - size));
            } else if (getHeight() > getWidth()) {
                setTranslateY(0.5 * (getHeight() - size));
            }

            frame.setPrefSize(size, size);
            frame.setBorder(gaugeDesign.getBorder(size));

            background.setCenterX(size * 0.5);
            background.setCenterY(size * 0.5);
            background.setRadius(size * 0.4375);

            background.setFill(gaugeBackground.getPaint(background.getLayoutBounds().getMinX(), background.getLayoutBounds().getMinY(),
                                                        background.getLayoutBounds().getMaxX(), background.getLayoutBounds().getMaxY()));

            switch(gaugeDesign) {
                case NONE:
                    frame.setVisible(false);
                    foreground.setVisible(false);
                    background.setVisible(false);
                    break;
                case ENZO:
                    background.setFill(Color.rgb(240, 240, 240));
                    innerShadow.setRadius(0.07407407 * size);
                    innerShadow.setOffsetX(0);
                    innerShadow.setOffsetY(0.07407407 * size);
                    innerShadow.setColor(Color.rgb(0, 0, 0, 0.35));
                    foreground.setFill(Color.TRANSPARENT);
                    foreground.setStroke(null);
                    break;
                default:
                    frame.setVisible(true);
                    foreground.setVisible(true);
                    background.setVisible(true);
                    innerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
                    innerShadow.setRadius(0.08 * size);
                    innerShadow.setOffsetX(0);
                    innerShadow.setOffsetY(0.0 * size);
                    foreground.setFill(new RadialGradient(0, 0, size * 0.5, size * gaugeDesign.FRAME_FACTOR * 0.5, size, false, CycleMethod.NO_CYCLE,
                                                          new Stop(0, Color.rgb(255, 255, 255, 0.6)),
                                                          new Stop(0.4, Color.TRANSPARENT)));
                    foreground.setStroke(null);
                    break;
            }

            gauge.setPrefSize(size * (1.0 - gaugeDesign.FRAME_FACTOR * 2.0), size * (1.0 - gaugeDesign.FRAME_FACTOR * 2.0));
            gauge.relocate(gaugeDesign.FRAME_FACTOR * size, gaugeDesign.FRAME_FACTOR * size);

            foreground.setCenterX(size * 0.5);
            foreground.setCenterY(size * 0.5);
            foreground.setRadius(size * 0.42);
        }
    }
366797
public void setShowProgressBackground(boolean show) {
        Drawable drawable = getCurrentDrawable();
        if (drawable instanceof ShowBackgroundDrawable) {
            ((ShowBackgroundDrawable) drawable).setShowBackground(show);
        }
        Drawable indeterminateDrawable = getIndeterminateDrawable();
        if (indeterminateDrawable instanceof ShowBackgroundDrawable) {
            ((ShowBackgroundDrawable) indeterminateDrawable).setShowBackground(show);
        }
    }
1126762
public void setForegroundIconColorDefault() {
        stopForegroundIconColorFadeAnimation();
        foregroundIcon.getStyleClass().clear();
        foregroundIcon.getStyleClass().add(JFXConstants.CSS_ICON);
        foregroundFadeIcon.setFill(Color.TRANSPARENT);
    }
917497
function setBackground()
  {
    $dat = @getimagesize($this->bgimg);
    if($dat == false) { return; }

    switch($dat[2]) {
      case 1:  $newim = @imagecreatefromgif($this->bgimg); break;
      case 2:  $newim = @imagecreatefromjpeg($this->bgimg); break;
      case 3:  $newim = @imagecreatefrompng($this->bgimg); break;
      case 15: $newim = @imagecreatefromwbmp($this->bgimg); break;
      case 16: $newim = @imagecreatefromxbm($this->bgimg); break;
      default: return;
    }

    if(!$newim) return;

    imagecopy($this->im, $newim, 0, 0, 0, 0, $this->image_width, $this->image_height);
  }
1010408
function _positionForeground(renderSize) {
        if (this._pullToRefreshDirection) {
            this._foreground.mod.transformFrom(Transform.translate(0, renderSize[1], 0));
        }
        else {
            this._foreground.mod.transformFrom(Transform.translate(renderSize[0], 0, 0));
        }
    }
224403
static ShapeDrawable getRoundedOutlineBackground(Resources resources, @ColorInt int color) {
        int r = resources.getDimensionPixelSize(R.dimen.com_auth0_lock_widget_corner_radius);
        int t = resources.getDimensionPixelSize(R.dimen.com_auth0_lock_input_field_stroke_width);
        RoundRectShape rr = new RoundRectShape(new float[]{r, r, r, r, r, r, r, r}, new RectF(t, t, t, t), new float[]{r, r, r, r, r, r, r, r});
        ShapeDrawable drawable = new ShapeDrawable(rr);
        drawable.getPaint().setColor(color);
        return drawable;
    }
1232575
public void setBackgroundDrawable(@NonNull Drawable drawable) {
    if (drawable == null) {
      throw new IllegalArgumentException("Cannot be null");
    }
    this.backgroundDrawable = drawable;
    isDecorated = true;
  }
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);
    }