Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 14, 2025

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-default with background-color CSS
  • 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 #DDF4FF instead 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.

Copilot AI and others added 2 commits August 14, 2025 23:40
Co-authored-by: DataStrategist <8094091+DataStrategist@users.noreply.github.com>
Co-authored-by: DataStrategist <8094091+DataStrategist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix color API Fix color API: add custom color support, change defaults, and eliminate Bootstrap terminology Aug 14, 2025
Copilot AI requested a review from DataStrategist August 14, 2025 23:45
@DataStrategist
Copy link
Owner

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

Copilot AI and others added 3 commits August 15, 2025 00:11
Co-authored-by: DataStrategist <8094091+DataStrategist@users.noreply.github.com>
…FF, update tests

Co-authored-by: DataStrategist <8094091+DataStrategist@users.noreply.github.com>
…tstrap classes

Co-authored-by: DataStrategist <8094091+DataStrategist@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 15, 2025

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:

  1. Default color changed to #DDF4FF as specified
  2. Eliminated all bootstrap color references - no more "primary", "success", "warning", etc.
  3. Simplified logic - removed complex bootstrap color detection and always use actual color values with background-color CSS
  4. Consistent panel styling - all boxes now use panel panel-default class
  5. 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

Copilot AI changed the title Fix color API: add custom color support, change defaults, and eliminate Bootstrap terminology Simplify color API: use #DDF4FF default and eliminate bootstrap color classes Aug 15, 2025
@DataStrategist DataStrategist marked this pull request as ready for review December 16, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix color API

2 participants