<?php

namespace Phiki\Theme;

class TokenColor
{
    /**
     * @param  Scope[]  $scope
     */
    public function __construct(
        public array $scope,
        public TokenSettings $settings,
    ) {}

    /**
     * @return \Phiki\Theme\ScopeMatchResult|false
     */
    public function match(array $scopes): ScopeMatchResult|bool
    {
        foreach ($this->scope as $scope) {
            if ($result = $scope->matches($scopes)) {
                return $result;
            }
        }

        return false;
    }
}
