Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/warga-saya.aplikasipos.info/vendor/spatie/color/src/
Upload File :
Current File : /home/aplikasiposinfo/www/warga-saya.aplikasipos.info/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 [
            Named::class,
            CIELab::class,
            Cmyk::class,
            Hex::class,
            Hsb::class,
            Hsl::class,
            Hsla::class,
            Rgb::class,
            Rgba::class,
            Xyz::class,
        ];
    }
}

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]