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
1616
1717***
1818- ``` PHP >= 7.3 ```
19- -
19+
2020## Installation
2121
2222You can install the package with Composer.
@@ -27,8 +27,29 @@ composer require binafy/php-color-generator
2727
2828## Usage
2929
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+ ```
3139
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+ ```
3253
3354<a name =" security " ></a >
3455## Security
You can’t perform that action at this time.
0 commit comments