File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ The `PHP Color Generator` is a versatile PHP package designed for easy and effic
16
16
17
17
***
18
18
- ``` PHP >= 7.3 ```
19
- -
19
+
20
20
## Installation
21
21
22
22
You can install the package with Composer.
@@ -27,8 +27,29 @@ composer require binafy/php-color-generator
27
27
28
28
## Usage
29
29
30
- ####
30
+ #### ` hexToRGB(string $hex): array `
31
+
32
+ If you may convert hex to RGB, you need to use ` hexToRGB ` method:
33
+
34
+ ``` php
35
+ use Binafy\PhpColorGenerator\ColorService;
36
+
37
+ ColorService::hexToRGB('1363df');
38
+ ```
31
39
40
+ #### ` rgbToHex(string $hex): string `
41
+
42
+ If you may convert RGB to hex, you need to use ` rgbToHex ` method:
43
+
44
+ ``` php
45
+ use Binafy\PhpColorGenerator\ColorService;
46
+
47
+ ColorService::rgbToHex([
48
+ 'red' => '19',
49
+ 'green' => '99',
50
+ 'blue' => '223',
51
+ ]);
52
+ ```
32
53
33
54
<a name =" security " ></a >
34
55
## Security
You can’t perform that action at this time.
0 commit comments