captcha-canvas API Documentation - v3.3.4
    Preparing search index...

    Interface SetCaptchaOption

    Configuration interface for CAPTCHA text appearance and generation in CaptchaGenerator.

    const config: SetCaptchaOption = {
    text: 'HELLO',
    size: 50,
    color: '#2c3e50'
    };
    const config: SetCaptchaOption = {
    characters: 8,
    size: 45,
    colors: ['#e74c3c', '#3498db', '#27ae60']
    };
    interface SetCaptchaOption {
        characters?: number;
        text?: string;
        color?: string;
        font?: string;
        skew?: boolean;
        colors?: string[];
        rotate?: number;
        size?: number;
        opacity?: number;
    }
    Index

    Properties

    characters?: number

    Number of random characters to generate (ignored if text is provided)

    text?: string

    Specific text to display (overrides random generation)

    color?: string

    Text color as hex code, RGB, or color name (overridden by colors array)

    font?: string

    Font family name (e.g., 'Arial', 'Times', 'Sans')

    skew?: boolean

    Whether to apply random skewing transformation to characters

    colors?: string[]

    Array of colors for multi-color text (overrides color property)

    rotate?: number

    Maximum rotation angle in degrees (±rotate range)

    size?: number

    Font size in pixels

    opacity?: number

    Text opacity (0.0 to 1.0)