Color   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rgb2bw() 0 4 1
1
<?php
2
3
namespace Imagecow\Utils;
4
5
/**
6
 * Generic color conversions functions.
7
 */
8
class Color
9
{
10
    /**
11
     * Returns a YUV weighted greyscale value.
12
     *
13
     * @param int $r
14
     * @param int $g
15
     * @param int $b
16
     *
17
     * @return int
18
     *
19
     * @see http://en.wikipedia.org/wiki/YUV
20
     */
21
    public static function rgb2bw($r, $g, $b)
22
    {
23
        return ($r * 0.299) + ($g * 0.587) + ($b * 0.114);
24
    }
25
}
26