Quick Reference
A comprehensive index of all functions, methods, and classes in the Vargula library. Click any item to jump to its full documentation in the API reference.
Instance Creation
Function |
Description |
|---|---|
Create an instance of Vargula to access its methods |
Core Styling Functions
Function |
Description |
|---|---|
Apply styling to text directly with colors and text decorations |
|
Format text using HTML-like markup tags for inline styling |
|
Create a custom reusable style tag for use with format() |
|
Delete a previously created custom style tag |
|
Format and print text with markup in one call |
|
Remove all markup tags from text, leaving only plain text |
|
Remove all ANSI escape codes from text |
|
Calculate the visible length of text, ignoring ANSI escape codes |
|
Globally enable all styling output |
|
Globally disable all styling output |
|
Context manager for temporary custom styles |
Theme Functions
Function |
Description |
|---|---|
Set a predefined or custom theme for consistent styling |
Table Functions
Class/Method |
Description |
|---|---|
Create a Rich-style table with extensive customization options |
|
Add a column definition to the table |
|
Add a row of data to the table |
Progress Bar Functions
Class/Method/Function |
Description |
|---|---|
Create a customizable progress bar for tracking operations |
|
Update the progress bar by advancing it n steps |
|
Complete and close the progress bar |
|
Wrap an iterable with a progress bar for automatic tracking |
|
Manage multiple progress bars simultaneously |
|
Add a new progress task to the multi-progress display |
|
Update a specific task in the multi-progress display |
Color Palette Generation
Function |
Description |
|---|---|
Generate a color palette based on color theory principles |
|
Generate a complete theme with semantic color names |
|
Generate a theme with colors validated for WCAG contrast |
|
Generate a visual text preview of a color palette |
|
Apply a generated palette as the active theme |
Color Manipulation Functions
Function |
Description |
|---|---|
Increase the brightness (value in HSV) of a color |
|
Decrease the brightness (value in HSV) of a color |
|
Increase the saturation of a color, making it more vivid |
|
Decrease the saturation of a color, making it more gray |
|
Rotate the hue of a color by specified degrees on the color wheel |
|
Invert a color by flipping its RGB values |
|
Mix two colors together with a specified weight |
Accessibility Functions
Function |
Description |
|---|---|
Calculate WCAG 2.1 contrast ratio between two colors |
|
Check if two colors meet WCAG contrast requirements |
|
Automatically adjust a foreground color to meet minimum contrast |
Color Blindness Functions
Function |
Description |
|---|---|
Simulate how a color appears to individuals with color blindness |
|
Check if colors in a palette remain distinguishable |
Persistence Functions
Function |
Description |
|---|---|
Save a color palette to a JSON file |
|
Load a color palette from a JSON file |
|
Save a theme palette to a JSON file |
|
Load a theme palette from a JSON file |
Function Categories
By Use Case
Instance Creation:
Vargula() - Creating an instance of Vargula
Text Styling:
Style Management:
create() - Create custom styles
delete() - Remove custom styles
temporary() - Temporary styles
set_theme() - Apply themes
Text Processing:
UI Components:
Table() - Data tables
ProgressBar() - Single progress bar
MultiProgress() - Multiple progress bars
Color Generation:
generate_palette() - Basic palettes
generate_theme_palette() - Semantic themes
generate_accessible_theme() - WCAG-compliant themes
Color Editing:
saturate(), desaturate() - Saturation
shift_hue() - Hue rotation
invert() - Color inversion
mix() - Color mixing
Accessibility:
calculate_contrast_ratio() - Measure contrast
meets_wcag() - Validate compliance
ensure_contrast() - Auto-adjust colors
simulate_colorblindness() - Simulate vision
validate_colorblind_safety() - Check palette
Data Persistence:
save_palette(), load_palette() - Palettes
save_theme(), load_theme() - Themes
Alphabetical Index
A-D |
E-L |
M-S |
T-Z |
|---|---|---|---|
Common Workflows
Basic Text Styling
Custom Style System
Theme Creation
generate_theme_palette() - Generate theme
preview_palette() - Preview colors
apply_palette_theme() - Apply theme
save_theme() - Save for later
Accessible Design
generate_accessible_theme() - Create compliant theme
calculate_contrast_ratio() - Verify contrast
meets_wcag() - Check compliance
simulate_colorblindness() - Test visibility
Data Visualization
Table() - Create table
Table.add_column() - Define columns
Table.add_row() - Add data
Progress Tracking
ProgressBar() - Create progress bar
ProgressBar.update() - Update progress
ProgressBar.close() - Finish
Quick Start Examples
Styling Text
from vargula import Vargula
vg = Vargula()
# Direct styling
print(vg.style("Error", color="red", look="bold"))
# Markup styling
print(vg.format("This is <red>red</red> and <bold>bold</bold>"))
# Custom styles
vg.create("error", color="red", look="bold")
print(vg.format("<error>Error!</error>"))
Creating Tables
table = vg.Table(title="Report")
table.add_column("Name", style="cyan")
table.add_column("Score", style="green", justify="right")
table.add_row("Alice", "95")
table.add_row("Bob", "87")
print(table)
Progress Bars
import time
# Simple progress bar
for i in vg.progress_bar(range(100), desc="Processing"):
time.sleep(0.01)
# Multiple progress bars
with vg.MultiProgress() as mp:
task1 = mp.add_task("Download", total=100)
task2 = mp.add_task("Extract", total=50)
# ... update tasks
Color Palettes
# Generate palette
colors = vg.generate_palette("#3498db", "complementary", 5)
# Preview colors
print(vg.preview_palette(colors))
# Create theme
theme = vg.generate_theme_palette("analogous", "#e74c3c")
vg.apply_palette_theme(theme)
Parameter Quick Reference
Common Parameters
Color Parameters: (used in style(), create(), etc.)
color- Foreground color (name, hex, or RGB tuple)bg- Background color (name, hex, or RGB tuple)
Look Parameters:
look- Text decoration(s) (string or list)Options:
bold,dim,italic,underline,blink,reverse,hidden,strikethrough
Table Parameters:
title- Table titlecaption- Table captionstyle- Default cell stylebox- Border style:"rounded","square","double","heavy","minimal","none"show_header- Display header row (bool)show_lines- Show lines between rows (bool)padding- Cell padding as (vertical, horizontal)expand- Expand to full width (bool)
Progress Bar Parameters:
total- Total iterationsdesc- Description textunit- Unit name (e.g., “files”, “items”)bar_width- Width in charactersshow_percentage- Display percentage (bool)show_count- Display count (bool)show_rate- Display rate (bool)show_eta- Display ETA (bool)
Palette Generation Parameters:
base_color- Starting hex colorscheme- Color harmony schemecount- Number of colors to generatesaturation_range- Min/max saturation (0-1)value_range- Min/max brightness (0-1)
WCAG Parameters:
level- Compliance level:"AA"or"AAA"large_text- Text is 18pt+ or 14pt+ bold (bool)min_contrast- Minimum contrast ratio (float)
Return Type Quick Reference
Function |
Returns |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Last Updated: 2025-11-30
Library Version: 2.0.0