1 | <?php |
||
28 | class SlackColor |
||
29 | { |
||
30 | const COLOR_DEFAULT = 'default'; |
||
31 | const COLOR_DANGER = 'danger'; |
||
32 | const COLOR_SUCCESS = 'success'; |
||
33 | const COLOR_WARNING = 'warning'; |
||
34 | const COLOR_INFO = 'info'; |
||
35 | |||
36 | const COLOR_MAP = [ |
||
37 | self::COLOR_DEFAULT, |
||
38 | self::COLOR_DANGER, |
||
39 | self::COLOR_SUCCESS, |
||
40 | self::COLOR_WARNING, |
||
41 | self::COLOR_INFO, |
||
42 | ]; |
||
43 | |||
44 | /** @var array */ |
||
45 | private $colorHexCodes = [ |
||
46 | self::COLOR_DEFAULT => '', |
||
47 | self::COLOR_DANGER => '', |
||
48 | self::COLOR_SUCCESS => '', |
||
49 | self::COLOR_WARNING => '', |
||
50 | self::COLOR_INFO => '', |
||
51 | ]; |
||
52 | |||
53 | /** |
||
54 | * SlackColor constructor. |
||
55 | * |
||
56 | * @param array $config |
||
57 | */ |
||
58 | public function __construct(array $config) |
||
65 | |||
66 | /** |
||
67 | * @param string $color |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getHex(string $color): string |
||
79 | } |
||
80 |