Passed
Push — master ( 689ec5...45f08c )
by Sebastian
05:26
created

ColorPresets::custom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * File containing the class {@see ColorPresets}.
4
 *
5
 * @see ColorPresets
6
 *@subpackage RGBAColor
7
 * @package AppUtils
8
 */
9
10
declare(strict_types=1);
11
12
namespace AppUtils\RGBAColor;
13
14
use AppUtils\RGBAColor;
15
16
/**
17
 * Quick access to the global color presets, as well as those that
18
 * were added via the manager.
19
 *
20
 * @package AppUtils
21
 * @subpackage RGBAColor
22
 * @author Sebastian Mordziol <[email protected]>
23
 */
24
class ColorPresets
25
{
26
    public static function white() : RGBAColor
27
    {
28
        return ColorFactory::createFromPreset(PresetsManager::COLOR_WHITE);
29
    }
30
31
    public static function black() : RGBAColor
32
    {
33
        return ColorFactory::createFromPreset(PresetsManager::COLOR_BLACK);
34
    }
35
36
    public static function transparent() : RGBAColor
37
    {
38
        return ColorFactory::createFromPreset(PresetsManager::COLOR_TRANSPARENT);
39
    }
40
41
    public static function custom(string $presetName) : RGBAColor
42
    {
43
        return ColorFactory::createFromPreset($presetName);
44
    }
45
}
46