Passed
Push — master ( 5153e5...af085a )
by Sebastian
05:42 queued 30s
created

RGBAColor_Presets   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A white() 0 3 1
A transparent() 0 3 1
A custom() 0 3 1
A black() 0 3 1
1
<?php
2
/**
3
 * File containing the class {@see RGBAColor_Presets}.
4
 *
5
 * @package AppUtils
6
 * @subpackage RGBAColor
7
 * @see RGBAColor_Presets
8
 */
9
10
declare(strict_types=1);
11
12
namespace AppUtils;
13
14
/**
15
 * Quick access to the global color presets, as well as those that
16
 * were added via the manager.
17
 *
18
 * @package AppUtils
19
 * @subpackage RGBAColor
20
 * @author Sebastian Mordziol <[email protected]>
21
 */
22
class RGBAColor_Presets
23
{
24
    public static function white() : RGBAColor
25
    {
26
        return RGBAColor_Factory::createFromPreset(RGBAColor_PresetsManager::COLOR_WHITE);
27
    }
28
29
    public static function black() : RGBAColor
30
    {
31
        return RGBAColor_Factory::createFromPreset(RGBAColor_PresetsManager::COLOR_BLACK);
32
    }
33
34
    public static function transparent() : RGBAColor
35
    {
36
        return RGBAColor_Factory::createFromPreset(RGBAColor_PresetsManager::COLOR_TRANSPARENT);
37
    }
38
39
    public static function custom(string $presetName) : RGBAColor
40
    {
41
        return RGBAColor_Factory::createFromPreset($presetName);
42
    }
43
}
44