Spaces:
Runtime error
Runtime error
File size: 1,765 Bytes
abab3e7 d041f14 abab3e7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | """
Core utilities for Design System Automation.
"""
from core.token_schema import (
TokenSource,
Confidence,
Viewport,
PageType,
ColorToken,
TypographyToken,
SpacingToken,
RadiusToken,
ShadowToken,
ExtractedTokens,
NormalizedTokens,
FinalTokens,
WorkflowState,
)
from core.color_utils import (
parse_color,
normalize_hex,
get_contrast_ratio,
check_wcag_compliance,
generate_color_ramp,
generate_accessible_ramp,
categorize_color,
suggest_color_name,
)
from core.rule_engine import (
run_rule_engine,
analyze_type_scale,
analyze_accessibility,
analyze_spacing_grid,
analyze_color_statistics,
TypeScaleAnalysis,
ColorAccessibility,
SpacingGridAnalysis,
ColorStatistics,
RuleEngineResults,
)
# HF Inference is imported lazily to avoid circular imports
# Use: from core.hf_inference import get_inference_client
__all__ = [
# Enums
"TokenSource",
"Confidence",
"Viewport",
"PageType",
# Token models
"ColorToken",
"TypographyToken",
"SpacingToken",
"RadiusToken",
"ShadowToken",
# Result models
"ExtractedTokens",
"NormalizedTokens",
"FinalTokens",
"WorkflowState",
# Color utilities
"parse_color",
"normalize_hex",
"get_contrast_ratio",
"check_wcag_compliance",
"generate_color_ramp",
"generate_accessible_ramp",
"categorize_color",
"suggest_color_name",
# Rule Engine
"run_rule_engine",
"analyze_type_scale",
"analyze_accessibility",
"analyze_spacing_grid",
"analyze_color_statistics",
"TypeScaleAnalysis",
"ColorAccessibility",
"SpacingGridAnalysis",
"ColorStatistics",
"RuleEngineResults",
]
|