驗證碼背景顏色是隨機了,有時候是深色。不想要深色應(yīng)該怎么修改,看代碼里面是隨機的,我修改了不生效。。 硬編碼改 也不生效。。。。。搞懵了。搞不定了,求大佬幫幫忙。
你應(yīng)該把你怎么改的發(fā)出來。
我是用的官方的驗證碼組件,代碼有點長。看了半天感覺應(yīng)該是CaptchaBuilder.php中的build里面的。
// ...其他代碼
if (empty($this->backgroundImages)) {
// if background images list is not set, use a color fill as a background
$image = imagecreatetruecolor($width, $height);
$bg = imagecolorallocate($image, 255, 255, 255); // 將背景顏色改為白色
$this->background = $bg;
imagefill($image, 0, 0, $bg);
} else {
// ...其他代碼
}