minor: типизация переменных
This commit is contained in:
@@ -3,7 +3,7 @@ import sys
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
def encode_to_base36(num):
|
def encode_to_base36(num: int) -> str:
|
||||||
"""Кодирует число в base-36: 0-9, A-Z, a-z"""
|
"""Кодирует число в base-36: 0-9, A-Z, a-z"""
|
||||||
if num < 0:
|
if num < 0:
|
||||||
raise ValueError("Number must be non-negative")
|
raise ValueError("Number must be non-negative")
|
||||||
@@ -19,7 +19,13 @@ def encode_to_base36(num):
|
|||||||
return ''.join(reversed(result))
|
return ''.join(reversed(result))
|
||||||
|
|
||||||
|
|
||||||
def generate_halftone_svg(image_path, output_path, cols=80, max_radius=8, animation_variants=12):
|
def generate_halftone_svg(
|
||||||
|
image_path: str,
|
||||||
|
output_path: str,
|
||||||
|
cols: int = 80,
|
||||||
|
max_radius: int = 8,
|
||||||
|
animation_variants: int = 12):
|
||||||
|
'''Генерирует SVG с полутоновым эффектом из изображения.'''
|
||||||
import random
|
import random
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user