mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-24 17:29:50 +01:00
Fix hexColor provider bug generating too short hex code
This commit is contained in:
parent
5ba95d8db5
commit
8b9bb44bbf
@ -47,7 +47,7 @@ class Color extends Base
|
||||
*/
|
||||
public static function hexColor()
|
||||
{
|
||||
return '#' . dechex(mt_rand(1, 16777215));
|
||||
return '#' . str_pad(dechex(mt_rand(1, 16777215)), 6, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user