Styling Text
The Arabic Animations library provides comprehensive styling options through the Style
class.
Basic Styling
from arabic_animations.core.color import Style, Color, Colors
# Basic black stroke
style = Style(
stroke_color=Colors.BLACK,
stroke_width=2.0
)
# Filled text
style = Style(
stroke_color=Colors.BLACK,
fill_color=Colors.BLUE,
stroke_width=2.0
)
Effects
Shadows
style = Style(
stroke_color=Colors.BLACK,
shadow_color=Color.from_hex("#00000066"), # Semi-transparent black
shadow_offset=(5, 5),
shadow_blur=2.0
)
Glow
Gradients
style = Style(
stroke_color=Colors.PRIMARY,
gradient=(Colors.PRIMARY, Colors.SECONDARY),
gradient_direction=(0, 50) # Vertical gradient over 50 pixels
)
Predefined Styles
Golden Title
title_style = Style(
stroke_color=Color.from_hex("#B8860B"),
fill_color=Color.from_hex("#FFD700"),
stroke_width=3.0,
shadow_color=Color.from_hex("#00000066"),
shadow_offset=(5, 5)
)