public function addByArray(string $name, array $styleConfig): self
    {
        $style = [
            'fg'      => '',
            'bg'      => '',
            'extra'   => false,
            'options' => []
        ];

        $config = \array_merge($style, $styleConfig);
        [$fg, $bg, $extra, $options] = \array_values($config);

        $this->styles[$name] = Color::make($fg, $bg, $options, (bool)$extra);

        return $this;
    }
public function addByArray(string $name, array $styleConfig): self
    {
        $style = [
            'fg'      => '',
            'bg'      => '',
            'extra'   => false,
            'options' => []
        ];

        $config = \array_merge($style, $styleConfig);
        [$fg, $bg, $extra, $options] = \array_values($config);

        $this->styles[$name] = Color::make($fg, $bg, $options, (bool)$extra);

        return $this;
    }
public function addByArray ( string $ name , array $ styleConfig ) : self { $ style = [ 'fg' => '' , 'bg' => '' , 'extra' => false , 'options' => [ ] ] ; $ config = \ array_merge ( $ style , $ styleConfig ) ; [ $ fg , $ bg , $ extra , $ options ] = \ array_values ( $ config ) ; $ this -> styles [ $ name ] = Color :: make ( $ fg , $ bg , $ options , ( bool ) $ extra ) ; return $ this ; }
Add a style by an array config
@param string $name
@param array  $styleConfig 样式设置信息
e.g
[
'fg' => 'white',
'bg' => 'black',
'extra' => true,
'options' => ['bold', 'underscore']
]
@return $this
Add a style by an array config