Skip to content

Commit 4c1eac3

Browse files
committed
Update README.md
1 parent 5a80510 commit 4c1eac3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff 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

2222
You 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

0 commit comments

Comments
 (0)