classcaptcha302::CaptchaImpl
sys::Obj captcha302::CaptchaImpl : captcha302::CaptchaWriter
A (somewhat lame) captcha writer implementation It is quite configurable and draws a variable number of chars with variable scales It also draws some lines under and over the chars to make it a bit harder to read
- bgColor
Color bgColor := Color.white- charLines
- charScale
Range charScale := 4..6- charStroke
Range charStroke := 5..9- chars
virtual override Int[] chars := "ACDEFGHJKLNPRTXY346".charsAvoiding characters that are look alike like i, l, 1, 0, o etc ..
- codeLength
Range codeLength := 4..4- create
virtual override Image302 create(CaptchaCode code)- height
Int height := 100- make
new make(|This? f)- maxBgStrokeSize
Int maxBgStrokeSize := 4- maxFgStrokeSize
Int maxFgStrokeSize := 4- nbBgLines
Int nbBgLines := 10- nbFgLines
Int nbFgLines := 10- next
Int next()- options
- r
Random r := Random.makeSecure- randomCode
virtual override CaptchaCode randomCode()- randomColor
- uniqueColor
Color uniqueColor(Color[] curColors, Int alpha := 200)get a random color that is not too much like another
- width
Int width := 300