Simplify color API: use #DDF4FF default and eliminate bootstrap color classes
This PR dramatically simplifies the TileMaker color API by removing complex bootstrap color detection logic and standardizing on actual color values.
Key Changes
1. New Default Color
All box functions now use #DDF4FF as the default color instead of bootstrap class names:
# Clean, simple API with pleasant default
solo_box(value = 42, txt = "Revenue") # Uses #DDF4FF background
# Custom colors work as before
solo_box(value = 85, txt = "Sales", color = "#FF6B35")
solo_box(value = 67, txt = "Growth", color = "darkgreen")
2. Eliminated Bootstrap Color Classes
Removed all references to bootstrap color terminology ("primary", "success", "warning", etc.). The API now only accepts actual color values:
- Before: Complex hybrid system supporting both bootstrap classes and colors
- After: Simple, consistent color value system (hex, named, rgb)
3. Simplified Implementation
- Removed
is_bootstrap_color()helper function - Eliminated conditional panel class logic
- Always use
panel panel-defaultwithbackground-colorCSS - Cleaner, more maintainable codebase
4. Preserved Gradient Functionality
solo_gradient_box retains its pleasant pastel color system:
-
High performance (≥90%):
#C8E6C9(pastel green) -
Medium performance (50-89%):
#FFF9C4(pastel yellow) -
Low performance (<50%):
#FFCDD2(pastel red)
5. Text Color Control
The text_color parameter continues to work for independent text styling:
solo_box(value = 42, txt = "Styled",
color = "#2E8B57", text_color = "white")
Technical Benefits
- Simpler API: No need to remember bootstrap class names
- Consistent behavior: All colors work the same way
-
Better defaults: Pleasant
#DDF4FFinstead of generic bootstrap blue - Reduced complexity: ~50% less color-handling code
- Future-proof: No dependency on bootstrap color conventions
Backward Compatibility
This is a breaking change for code using bootstrap color class names. Migration is straightforward:
# Old (no longer works)
solo_box(value = 42, color = "warning")
# New (simple replacement)
solo_box(value = 42, color = "#FFC107") # Same visual result
Fixes #25.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Too compicated. Simplify your implementation a lot... for example, the default color for buttons should be: #DDF4FF. Get rid of all references to bootstrap's primary, success, warning, etc. The gradient_box functionality is fine. @copilot
Too compicated. Simplify your implementation a lot... for example, the default color for buttons should be:
#DDF4FF. Get rid of all references to bootstrap's primary, success, warning, etc. The grad...
I've simplified the implementation significantly as requested. The changes include:
-
Default color changed to
#DDF4FFas specified - Eliminated all bootstrap color references - no more "primary", "success", "warning", etc.
-
Simplified logic - removed complex bootstrap color detection and always use actual color values with
background-colorCSS -
Consistent panel styling - all boxes now use
panel panel-defaultclass - Preserved gradient functionality - kept the pastel colors (#C8E6C9, #FFF9C4, #FFCDD2)
The API is now much cleaner: all color parameters accept actual color values (hex, named, rgb) and the default is the pleasant #DDF4FF you requested.
Commit: cfd0f01