1
0
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:
Francois Zaninotto 2013-07-08 11:31:33 +02:00
parent 5ba95d8db5
commit 8b9bb44bbf

View File

@ -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);
}
/**