Metadata-Version: 2.3
Name: color-captcha
Version: 0.1.4
Summary: Dynamically generated, AI-resistant captcha images
Project-URL: Homepage, https://github.com/stefs304/color-captcha
Project-URL: Issues, https://github.com/stefs304/color-captcha/issues
Author: Stefan Stojanovic
License: MIT License
        
        Copyright (c) 2024 Stefan Stojanovic
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: captcha,captcha-generator,captcha-image,clock,digital,python
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: pillow
Description-Content-Type: text/markdown

# color-captcha
Dynamically generated, AI-resistant captcha images. 

![captcha](https://raw.githubusercontent.com/stefs304/clockcaptcha/master/color-captcha.png)

*Can you tell what time it is? AI can't.*

> Features:
> * dynamically generated images
> * rgb and grayscale color mode
> * 12-hour and 24-hour clock mode
> * custom colors

### Installation

```shell
pip install color-captcha
```

### Usage

```python
from color_captcha import ClockCaptcha

captcha = ClockCaptcha()
print(captcha.value)

captcha.verify('0645') # True/False
captcha.save_image('image.png')

# generate new captcha
captcha.generate_new()

```
Choose between `color_mode='rgb'` ([color-captcha.png](color-captcha.png)) 
or `'grayscale'` ([grayscale-captcha.png](grayscale-captcha.png)). 

Pick between a 12-hour or a 24-hour `clock_mode`.
```python
from color_captcha import ClockCaptcha

captcha = ClockCaptcha(clock_mode=12)
```

Image size can be changed with relative `size` parameter. Here are corresponding pixel values. 

| size  | width   | height  |
|-------|---------|---------|
| 1     | 190     | 65      |
| 2     | 380     | 130     |
| **3** | **570** | **195** |
| 4 | 760 | 260 |
| ... | ... | ... | 

Change colors globally:
```python
from color_captcha import ClockCaptcha
ClockCaptcha.set_colors([
    '#FFFFFF',
    '#000000',
    '#999999'
])
```

