Begins a new shape. The shape should be ended with a call to endShape.

@param \Jdenticon\Color $color The color of the shape.
547093
public function beginShape(\Jdenticon\Color $color)
    {
        $this->draw->setFillColor($color->__toString());
        $this->draw->pathStart();
    }
158031
public function write($x, $y, $color)
    {
        if(isset($this->canvas[$y][$x])) {
            $this->canvas[$y][$x] = $color;
        }
    }
675067
protected function _set_fill_color($color)
    {
        $this->_pdf->setColor($color);
        $alpha = isset($color["alpha"]) ? $color["alpha"] : 1;
        if ($this->_current_opacity) {
            $alpha *= $this->_current_opacity;
        }
        $this->_set_fill_transparency("Normal", $alpha);
    }
1163454
function setBgColor($color)
    {
        $value = $this->_getColor($color);
        $this->_bg_color = $value;
        if ($this->_pattern == 0) { // force color to be seen
            $this->_pattern = 1;
        }
    }
334179
public function add($color)
    {
        if (!empty($color)) {
            $color = self::getColorAsFullHexCode($color);
            if (!in_array($color, $this->_colors)) {
                $this->_colors[] = $color;
            }
        }
    }
696058
public static function create($color)
    {
        $template = 'Length of hexadecimal value of color \'%s\' is incorrect. It\'s %d, but it should be 3 or 6.'
            . ' Is there everything ok?';

        $message = sprintf($template, $color, strlen($color));

        return new static($message);
    }
596467
protected function initialize($color)
    {
        return list($this->red, $this->green, $this->blue) = str_split($color, 2);
    }
1352148
private function createEllipse($color)
    {
        $alpha = imagecolorallocatealpha($this->resource, 255, 255, 255, 127);
        imagefill($this->resource, 0, 0, $alpha);

        imagefilledellipse(
            $this->resource,
            $this->width / 2,
            $this->height / 2,
            $this->width,
            $this->height,
            $color
        );
    }
9109
public function setColor($color) {

        // if null is passed in, then just leave everything null
        if (!is_null($color)) {

            // if it an instance of another color
            if ($color instanceof ColorInterface) {

                // save the name
                $this->name = $color->getName();

                // save the xterm code
                $this->XTermCode = $color->getXTermCode();

                // save the RGB
                $this->RGB = $color->getRGB();

                // save the ansi code
                $this->ANSICode = $color->getANSICode();

                // if it is string, then it is a color name (maybe)
            } else if (is_string($color)) {

                if (Colors::isValidColorName($color)) {

                    $this->name = Colors::stripName($color);

                    // get the code for that name
                    $this->XTermCode = Colors::getXTermCode($this->name);

                    // save the RGB
                    $this->RGB = Colors::getRGB($this->name);

                    // get the ANSI code
                    $this->ANSICode = Colors::getANSICode($this->name);

                }

                // if it is an integer, then it is likely a xterm code
            } else if (is_int($color)) {

                // if it is between 0 and 255
                if ($color >= 0 && $color <= 255) {

                    // save this code
                    $this->XTermCode = $color;

                    // get the RGB for it
                    $this->name = Colors::getColorIndexForXTermCode($this->XTermCode);

                    // get the RGB
                    $this->RGB = Colors::getRGB($this->name);

                    // get the ANSI Code
                    $this->ANSICode = Colors::getANSICode($this->name);
                }

                // if it is an RGB array
            } else if (is_array($color)) {

                // there must be three items in the array
                if (count($color) === 3) {

                    // save the RGB
                    $this->RGB = $color;

                    // match this RGB to some code
                    $this->name = Colors::matchRGB($this->RGB);

                    // get the nearest ANSI Code
                    $this->ANSICode = Colors::getANSICode($this->name);

                    // get the nearest XTerm code
                    $this->XTermCode = Colors::getXTermCode($this->name);

                }
            }

        // null was passed in
        } else {

            // set the color to be empty
            $this->setEmpty();
        }
    }
823915
public function setColor($color)
    {
        if (null === $color) {
            return $this;
        }

        $this->color = $this->convertColor($color);

        return $this;
    }
603434
public void setCustomLedColor(final Color COLOR) {
        model.setCustomLedColor(new CustomLedColor(COLOR));
        final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;

        switch (getOrientation()) {
            case HORIZONTAL:
                recreateLedImages(getHeight());
                break;
            case VERTICAL:
                recreateLedImages(getWidth());
                break;
            default:
                recreateLedImages();
                break;
        }

        if (currentLedImage != null) {
            currentLedImage.flush();
        }
        currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;

        repaint(getInnerBounds());
    }
346908
public function setUseColor(?bool $useColor): void
    {
        if (null === $useColor) {
            $useColor = $this->featureDetector->isSupported('stdout.ansi');
        }

        // @codeCoverageIgnoreStart
        if ($useColor) {
            $this->addStart = "\033[33m\033[2m{+\033[0m\033[33m\033[4m";
            $this->addEnd = "\033[0m\033[33m\033[2m+}\033[0m";
            $this->removeStart = "\033[36m\033[2m[-\033[0m\033[36m\033[4m";
            $this->removeEnd = "\033[0m\033[36m\033[2m-]\033[0m";
        } else {
            // @codeCoverageIgnoreEnd
            $this->addStart = '{+';
            $this->addEnd = '+}';
            $this->removeStart = '[-';
            $this->removeEnd = '-]';
        }
    }
325952
public void setColor(final Color COLOR) {
        if (null == color) {
            _color = COLOR;
        } else {
            color.set(COLOR);
        }
        fireMarkerEvent(COLOR_CHANGED_EVENT);
    }
372196
public function addColor($color)
    {
        if ( ! $color instanceof Color ) {
            $color = new Color($color);
        }

        $this->colors []= $color;
    }
145500
public function setTransparent($color) {
	    $color = call_user_func_array([$this, 'getColorWithRGB'], func_get_args());
	    return imagecolortransparent($this->image, $color);
    }
726447
public function startAction($message, $color = self::CWHITE, $microtime = null) {
        $this->endAction();
        $this->endProgressBar();
        $this->currentActionHadLogs = false;
        $this->pendingActionLogs = array();
        $this->currentAction = array('length' => 19 + strlen($this->timeTextSeparator) + $this->getTextLength($message),
            'errors' => false,
            'color' => $color,
            'message' => '',
            'time' => $microtime ? $microtime : microtime(true));
        $r = $this->color($message, $color);
        return $this->output($r);
    }
1369371
public void setStartCornerColor(Color color) {
        if (startColor == null) {
            startColor = new RGBColor(0.0, 0.0, 0.0);
        }
        setGradation(true);
        this.startColor = color;
    }