diff --git a/internal/captcha/dwelling_captcha.go b/internal/captcha/dwelling_captcha.go index 97af92c..82110d5 100644 --- a/internal/captcha/dwelling_captcha.go +++ b/internal/captcha/dwelling_captcha.go @@ -29,11 +29,19 @@ func (c *DwellingCaptcha) generateImage(style string) *image.Image { ctx := gg.NewContext(dwImageWidth, dwImageHeight) // fill background - ctx.SetRGB255(0x0a, 0x0a, 0x0a) + if style == "dark" { + ctx.SetRGB255(0x0a, 0x0a, 0x0a) + } else { + ctx.SetRGB255(0xf5, 0xf5, 0xf5) + } ctx.Clear() // draw text - ctx.SetRGB255(0xf5, 0xf5, 0xf5) + if style == "dark" { + ctx.SetRGB255(0xf5, 0xf5, 0xf5) + } else { + ctx.SetRGB255(0x0a, 0x0a, 0x0a) + } ctx.Scale(4.0, 2.7) ctx.DrawStringAnchored(string(c.GetAnswer()), 20, 5, .5, .5)