Using the following captcha action config. I just revered the default fore and back colors
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
'captcha' => [
'class' => 'yii\captcha\CaptchaAction',
'fixedVerifyCode' => YII_ENV_TEST ? 'a' : null,
'maxLength' => 3,
'minLength' => 1,
'offset' => 0,
'backColor' => '0x2040A0',
'foreColor' => '0xFFFFFF'
],
];
}`
A captcha with white font and blue background
Black background and font
| Q | A
| ---------------- | ---
| Yii version | 2.0.13.1
| PHP version | 7.0.8
| Operating system | Win7
backColor and foreColor expect values of integer type, not strings. Not sure if that's the source of the problem though.
@Kolyunya is right: backColor and foreColor are just numbers (Source).
@esaesa just remove the quotes around the color codes.

Most helpful comment
@Kolyunya is right: backColor and foreColor are just numbers (Source).

@esaesa just remove the quotes around the color codes.