Skip to content

Commit

Permalink
chore: getImageColors in readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tomloprod committed Jun 3, 2024
1 parent 59e48c6 commit c5df1fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ $hslColor = $hexColor->toHsl();

### Color utilities

#### getImageColors

It allows you to obtain the colors detected in an image. As the first argument, the path to the image must be provided.

It has an optional second parameter (default is 5) that specifies the number of colors to be returned.

![getImageColors gif](./docs/example-get-image-colors.gif)

```php
/** @var array<RgbColor> $imageColors */
$imageColors = colority()->getImageColors(
imagePath: __DIR__.'/image-colors.png',
desiredNumColors: 10
);
```

#### textToColor

Generate a fixed color based on a string.
Expand Down
Binary file added docs/example-get-image-colors.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c5df1fd

Please sign in to comment.