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

RGBAColor_Presets::white()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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