Custom color palette for your CAPTCHA image
Using the CandyPress config pages you can choose to use CAPTCHA (completely automated public Turing-test to tell computers and humans apart) to protect your forms from malicious spam entries.
CAPTCHA is a Classic ASP Security Image Generator which generate images with letters and numbers to make a CAPTCHA test.
It's really nifty ASP code that generates an image, to see if the entry is made by humans you need to copy the letters and numbers on the image.
When you log into your CandyPress administration you can activate this ot the "Store Configuration > Store General" page .

CAPTCHA code is opensource and available for free at tipstricks and can be used in your ASP application.
Features are :
- Completely FREE Classic ASP VBScript.
- The secure code is completely random.
- Dynamic image processing.
- No image file requires.
- No components requires.
- Create a cross browser compatible BMP images.
- You can use a custom color palette for image.
So you can use a custom color palette, this means it's possible to integrate the image fully in you custom designed theme.
Scroll down to the bottom of the TipsTricks website and you'll see this screenshot below.
All you need to do now is choose your color combination for the background, noise and text.
Use the sliders or enter the RGB value to find your matching color combination.
Once you have the correct color combination click the "Add combination" button.
Second and last step will generate your custom code.
Click on the "Generate Palette" button.
To use this custom color combination you need to edit 1 file inside your /scripts/ folder.
Open your text editor and locate the file /scripts/_INCcaptcha.asp, both CP5 and CP6 use the same file, so this applies to both versions.
-
Replace the code block starting at line #42 to #57 with your custom generated code
'#Begin ColorMap
'http://www.tipstricks.org/aspsig/colormap.asp
const BmpColorMap = "dffeff000c8517..."
ColorMap = Array(_
split("00,01,01",",") ,_
split("02,03,03",",") ,_
split("04,05,05",",") ,_
split("06,07,07",",") ,_
split("08,09,09",",") ,_
split("0A,0B,0B",",") ,_
split("0C,0D,0D",",") ,_
split("00,05,05",",") ,_
split("0E,0F,0F",",") ,_
split("10,11,11",",") _
)'End ColorMap
-
That's all there is to it to have a custom Captcha image.
There are some more settings you can play with a bit further below inside the _INCcaptcha.asp file.
Take a look at the line starting at #65 to #71, you can set the image width and height or change the noise effect or alter some other settings.dim Bitmap(25,130) '[Height,Width]
const CodeLength = 8 'Secure code length (Max:8)
const CharTracking = 2 'Set the tracking between two characters
const RndTopMargin = true 'Randomize top margin every character
const NoiseEffect = 2 '0[none], 1[sketch], 2[random foreground
lines], 3[random background lines], 4[1 and 3 (Recommed maximum NoiseLine=4)]
const NoiseLine = 8 'Low values make easy OCR, high values decrease readability
const MinLineLength = 6 'Minimum noise line length
If you have any questions, please use the comments or drop me an email.

Comments