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

ColorPresets   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 5
c 0
b 0
f 0
dl 0
loc 20
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A transparent() 0 3 1
A white() 0 3 1
A custom() 0 3 1
A black() 0 3 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