@@ -29,28 +29,87 @@ composer require binafy/php-color-generator
2929
3030#### ` hexToRGB(string $hex): array `
3131
32- If you may convert hex to RGB, you need to use ` hexToRGB ` method:
32+ If you may convert hex to RGB, you need to use ` hexToRGB() ` method:
3333
3434``` php
35- use Binafy\PhpColorGenerator\ColorService ;
35+ use Binafy\PhpColorGenerator\Color ;
3636
37- ColorService ::hexToRGB('1363df');
37+ Color ::hexToRGB('1363df');
3838```
3939
4040#### ` rgbToHex(string $hex): string `
4141
42- If you may convert RGB to hex, you need to use ` rgbToHex ` method:
42+ If you may convert RGB to hex, you need to use ` rgbToHex() ` method:
4343
4444``` php
45- use Binafy\PhpColorGenerator\ColorService ;
45+ use Binafy\PhpColorGenerator\Color ;
4646
47- ColorService ::rgbToHex([
47+ Color ::rgbToHex([
4848 'red' => '19',
4949 'green' => '99',
5050 'blue' => '223',
5151]);
5252```
5353
54+ #### ` darken(array $rgb, float $percentage): array `
55+
56+ If you may get darken rgb color, you can use ` darken() ` method:
57+
58+ ``` php
59+ use Binafy\PhpColorGenerator\Color;
60+
61+ Color::darken([
62+ 'red' => '19',
63+ 'green' => '99',
64+ 'blue' => '223',
65+ ], 0.5); // array ('red', 'blue', 'green')
66+ ```
67+
68+
69+ #### ` lighten(array $rgb, float $percentage): array `
70+
71+ If you may get lighten rgb color, you can use ` lighten() ` method:
72+
73+ ``` php
74+ use Binafy\PhpColorGenerator\Color;
75+
76+ Color::lighten([
77+ 'red' => '19',
78+ 'green' => '99',
79+ 'blue' => '223',
80+ ], 0.5); // array ('red', 'blue', 'green')
81+ ```
82+
83+ #### ` generateShades(string $hex, int $times): array `
84+
85+ If you want to generate shades from hex color, you can use ` generateShades() ` method:
86+
87+ ``` php
88+ use Binafy\PhpColorGenerator\Color;
89+
90+ Color::generateShades('1363df', 10);
91+ ```
92+
93+ #### ` generateTints(string $hex, int $times): array `
94+
95+ If you want to generate tints from hex color, you can use ` generateTints() ` method:
96+
97+ ``` php
98+ use Binafy\PhpColorGenerator\Color;
99+
100+ Color::generateTints('1363df', 10);
101+ ```
102+
103+ #### ` generateDarkBrightColors(string $hex, int $times = 10): array `
104+
105+ If you want to generate tints, shades from hex color, you can use ` generateDarkBrightColors() ` method:
106+
107+ ``` php
108+ use Binafy\PhpColorGenerator\Color;
109+
110+ Color::generateDarkBrightColors('1363df', 10); // array ('dark', 'light')
111+ ```
112+
54113<a name =" security " ></a >
55114## Security
56115
0 commit comments