Вход Регистрация
Файл: vendor/intervention/image/src/Modifiers/FillModifier.php
Строк: 59
<?php

declare(strict_types=1);

namespace 
InterventionImageModifiers;

use 
InterventionImageDriversSpecializableModifier;
use 
InterventionImageExceptionsColorDecoderException;
use 
InterventionImageExceptionsStateException;
use 
InterventionImageInterfacesColorInterface;
use 
InterventionImageInterfacesPointInterface;

class 
FillModifier extends SpecializableModifier
{
    public function 
__construct(
        public 
string|ColorInterface $color,
        public ?
PointInterface $position null,
    ) {
        
//
    
}

    
/**
     * Determine if the modifier has a position defined.
     */
    
public function hasPosition(): bool
    
{
        return 
$this->position instanceof PointInterface;
    }

    
/**
     * Return filling color object:
     *
     * @throws ColorDecoderException
     * @throws StateException
     */
    
protected function color(): ColorInterface
    
{
        return 
$this->driver()->decodeColor($this->color);
    }
}
Онлайн: 1
Реклама