|
| 1 | +## `hexColor` |
| 2 | + |
| 3 | +Generate a random hex color. |
| 4 | + |
| 5 | +```php |
| 6 | +$faker->hexColor(); |
| 7 | + |
| 8 | +// '#ccd578', '#fafa11', '#ea3781' |
| 9 | +``` |
| 10 | + |
| 11 | +## `safeHexColor` |
| 12 | + |
| 13 | +Generate a random hex color, containing only 16 values per R, G and B. |
| 14 | + |
| 15 | +```php |
| 16 | +$faker->safeHexColor(); |
| 17 | + |
| 18 | +// '#00eecc', '#00ff88', '#00aaee' |
| 19 | +``` |
| 20 | + |
| 21 | +## `rgbColorAsArray` |
| 22 | + |
| 23 | +Generate a random RGB color, as an `array`. |
| 24 | + |
| 25 | +```php |
| 26 | +$faker->rgbColorAsArray(); |
| 27 | + |
| 28 | +// [0 => 30, 1 => 22, 2 => 177], [0 => 150, 1 => 55, 2 => 34], [0 => 219, 1 => 253, 2 => 248] |
| 29 | +``` |
| 30 | + |
| 31 | +## `rgbColor` |
| 32 | + |
| 33 | +Generate a comma-separated RGB color `string`. |
| 34 | + |
| 35 | +```php |
| 36 | +$faker->rgbColor(); |
| 37 | + |
| 38 | +// '105,224,78', '97,249,98', '24,250,221' |
| 39 | +``` |
| 40 | + |
| 41 | +## `rgbCssColor` |
| 42 | + |
| 43 | +Generate a CSS-friendly RGB color `string`. |
| 44 | + |
| 45 | +```php |
| 46 | +$faker->rgbCssColor(); |
| 47 | + |
| 48 | +// 'rgb(9,110,101)', 'rgb(242,133,147)', 'rgb(124,64,0)' |
| 49 | +``` |
| 50 | + |
| 51 | +## `rgbaCssColor` |
| 52 | + |
| 53 | +Generate a CSS-friendly RGBA (alpha channel) color `string`. |
| 54 | + |
| 55 | +```php |
| 56 | +$faker->rgbaCssColor(); |
| 57 | + |
| 58 | +// 'rgba(179,65,209,1)', 'rgba(121,53,231,0.4)', 'rgba(161,239,152,0.9)' |
| 59 | +``` |
| 60 | + |
| 61 | +## `safeColorName` |
| 62 | + |
| 63 | +Generate a CSS-friendly color name. |
| 64 | + |
| 65 | +```php |
| 66 | +$faker->safeColorName(); |
| 67 | + |
| 68 | +// 'white', 'fuchsia', 'purple' |
| 69 | +``` |
| 70 | + |
| 71 | +## `colorName` |
| 72 | + |
| 73 | +Generate a CSS-friendly color name. |
| 74 | + |
| 75 | +```php |
| 76 | +$faker->colorName(); |
| 77 | + |
| 78 | +// 'SeaGreen', 'Crimson', 'DarkOliveGreen' |
| 79 | +``` |
| 80 | + |
| 81 | +## `hslColor` |
| 82 | + |
| 83 | +Generate a random HSL color `string`. |
| 84 | + |
| 85 | +```php |
| 86 | +$faker->hslColor(); |
| 87 | + |
| 88 | +// '87,10,25', '94,24,27', '207,68,84' |
| 89 | +``` |
| 90 | + |
| 91 | +## `hslColorAsArray` |
| 92 | + |
| 93 | +Generate a random HSL color, as an `array`. |
| 94 | + |
| 95 | +```php |
| 96 | +$faker->hslColorAsArray(); |
| 97 | + |
| 98 | +// [0 => 311, 1 => 84, 2 => 31], [0 => 283, 1 => 85, 2 => 49], [0 => 57, 1 => 48, 2 => 36] |
| 99 | +``` |
0 commit comments