@@ -8,14 +8,17 @@ class RGBColor extends Color {
88 public $ blue = 0 ;
99 public $ alpha = 1 ;
1010
11- function __construct ($ r = 0 , $ g = 0 , $ b = 0 , $ a =1 ) {
11+ public function __construct ($ r = 0 , $ g = 0 , $ b = 0 , $ a =1 ) {
1212 $ this ->red = $ r ;
1313 $ this ->green = $ g ;
1414 $ this ->blue = $ b ;
1515 $ this ->alpha = $ a ;
1616 }
1717
18- function toHSV () {
18+ /**
19+ * {@inheritdoc}
20+ */
21+ public function toHSV () {
1922 $ r = ((int )$ this ->red % 256 ) / 255 ;
2023 $ g = ((int )$ this ->green % 256 ) / 255 ;
2124 $ b = ((int )$ this ->blue % 256 ) / 255 ;
@@ -46,7 +49,10 @@ function toHSV() {
4649 return new HSVColor ($ h *360 , $ s *100 , $ v *100 , $ a );
4750 }
4851
49- function toHSL () {
52+ /**
53+ * {@inheritdoc}
54+ */
55+ public function toHSL () {
5056 $ r = ((int )$ this ->red % 256 ) / 255 ;
5157 $ g = ((int )$ this ->green % 256 ) / 255 ;
5258 $ b = ((int )$ this ->blue % 256 ) / 255 ;
@@ -77,7 +83,10 @@ function toHSL() {
7783 return new HSLColor ($ h *360 , $ s *100 , $ l *100 , $ a );
7884 }
7985
80- function toCMYK () {
86+ /**
87+ * {@inheritdoc}
88+ */
89+ public function toCMYK () {
8190 $ r = ((int )$ this ->red % 256 ) / 255 ;
8291 $ g = ((int )$ this ->green % 256 ) / 255 ;
8392 $ b = ((int )$ this ->blue % 256 ) / 255 ;
@@ -95,17 +104,26 @@ function toCMYK() {
95104 return new CMYKColor ($ c *100 , $ m *100 , $ y *100 , $ k *100 , $ a );
96105 }
97106
98- function toRGB () {
107+ /**
108+ * {@inheritdoc}
109+ */
110+ public function toRGB () {
99111 return clone $ this ;
100112 }
101113
102- function toCSS ($ alpha = null ) {
114+ /**
115+ * {@inheritdoc}
116+ */
117+ public function toCSS ($ alpha = null ) {
103118 return ($ alpha === true || $ this ->alpha < 1 ) && $ alpha !== false
104119 ? sprintf ('rgba(%d, %d, %d, %s) ' , $ this ->red , $ this ->green , $ this ->blue , $ this ->alpha )
105120 : sprintf ('rgb(%d, %d, %d) ' , $ this ->red , $ this ->green , $ this ->blue );
106121 }
107122
108- function toHex () {
123+ /**
124+ * {@inheritdoc}
125+ */
126+ public function toHex () {
109127 $ stack = array ('# ' );
110128 $ stack [] = str_pad (dechex (min (255 , round ($ this ->red ))), 2 , '0 ' , STR_PAD_LEFT );
111129 $ stack [] = str_pad (dechex (min (255 , round ($ this ->green ))), 2 , '0 ' , STR_PAD_LEFT );
0 commit comments