Skip to content

Commit

Permalink
chore: improve readme (getSimilarText and textToColor)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomloprod committed May 26, 2024
1 parent fa22fec commit 34cf4dc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,20 @@ $hslColor = $hexColor->toHsl();

Generate a fixed color based on a string.

![getSimilarColor gif](./docs/example-text-to-color.gif)

```php
/** @var HslColor $hslColor */
$hslColor = colority()->textToColor("Hi, I'm Tomás");
```
> **🧙 Advise**
> Useful for generating a color associated with, for example, a username, mail address, etc, since a string will always return the same color.
> Useful for generating a color associated with, for example, **a username, mail address, etc**, since a string will always return the same color.
#### getSimilarColor
Allows you to obtain a random color similar (*in the same color palette*) to a given color.

![getSimilarColor gif](./docs/example-get-similar-color.gif)

```php
/** @var HexColor|null $hexColor */
$hexColor = colority()->fromHex('#51B389');
Expand Down
Binary file added docs/example-get-similar-color.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/example-get-similar-color.mp4
Binary file not shown.
Binary file added docs/example-text-to-color.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/example-text-to-color.mp4
Binary file not shown.

0 comments on commit 34cf4dc

Please sign in to comment.