Added a universal transparency slider to the Ultra Card color picker component that allows users to adjust color opacity from 0% (fully transparent) to 100% (fully opaque) with automatic format conversion between HEX and RGBA.
- File:
/src/components/ultra-color-picker.ts - Component:
ultra-color-picker
- Located between the text input section and color palette grid
- Range slider from 0-100% with visual feedback
- Real-time percentage display
- Visual preview track showing transparency gradient
- Contextual hint text showing current format (HEX vs RGBA)
- 100% opacity: Displays as HEX format (e.g.,
#FF0000) - 0% opacity: Displays as
transparentkeyword - 1-99% opacity: Automatically converts to RGBA format (e.g.,
rgba(255, 0, 0, 0.50)) - Real-time updates to the value field as you slide
Supports all color formats:
- HEX colors (
#RRGGBB) - RGB/RGBA colors (
rgb(r,g,b)/rgba(r,g,b,a)) - HSL/HSLA colors (
hsl(h,s%,l%)/hsla(h,s%,l%,a)) - CSS variables (
var(--primary-color)) - Named colors (
red,blue, etc.) - 8-digit HEX with alpha (
#RRGGBBAA)
- When selecting a new color from the palette, the current transparency level is preserved
- Transparency is extracted and maintained when colors are loaded from configuration
- Consistent behavior across all color selection methods
@state() private _transparency = 100; // 0-100, where 100 is fully opaque-
_extractTransparency(color?: string): number- Extracts transparency from any color format
- Returns value from 0-100
-
_hexToRgb(hex: string)- Converts HEX colors to RGB values
-
_getBaseColor(color?: string): string- Extracts base color without alpha channel
- Handles all supported color formats
-
_applyTransparency(baseColor: string, transparency: number): string- Applies transparency to a base color
- Intelligently chooses output format (HEX at 100%, RGBA otherwise)
-
_handleTransparencyChange(event: Event): void- Handles slider input events
- Updates color format in real-time
- Dispatches value-changed events
firstUpdated(): Extracts initial transparency from valueupdated(): Re-extracts transparency when value prop changes_selectColor(): Applies current transparency to newly selected colors
- Clean, modern slider with custom thumb styling
- Checkered background pattern showing transparency (like Photoshop/Figma)
- Color gradient preview showing current color at different opacities
- Primary color themed slider thumb
- Smooth hover and active state animations
- Real-time percentage display
- Contextual hints explaining current format
- Visual preview of transparency effect
- Smooth transitions and animations
- Works seamlessly on desktop and mobile
- Touch-friendly slider controls
- Maintains functionality on all screen sizes
- Webkit/Chrome: Custom
-webkit-slider-thumbstyling - Firefox: Custom
-moz-range-thumbstyling - Safari: Full support via webkit prefixes
- Edge: Native support
- Select
#FF0000(red) from palette → Shows as HEX - Move slider to 50% → Auto-converts to
rgba(255, 0, 0, 0.50) - Value updates in text field in real-time
- Select any color
- Move slider to 0% → Displays as
transparent - Format hint shows "0% = Fully transparent"
- Set transparency to 50%
- Select different colors from palette
- All colors maintain 50% transparency automatically
- ✅ Universal transparency control for all colors
- ✅ Intuitive slider interface
- ✅ Real-time visual feedback
- ✅ No manual format conversion needed
- ✅ Works consistently across the entire card
- ✅ Clean, maintainable code
- ✅ Comprehensive format support
- ✅ No breaking changes to existing functionality
- ✅ Follows project coding standards
- ✅ Fully typed TypeScript implementation
- ✅ Compiles without errors
- ✅ No linting issues
- ✅ Builds successfully with webpack
- ✅ All color formats supported
- ✅ Transparency persists across selections
- ✅ Real-time updates working
- HEX to RGBA conversion: Works ✅
- RGBA to HEX conversion (at 100%): Works ✅
- CSS variable handling: Works ✅
- Transparency preservation: Works ✅
- Edge cases (0%, 100%): Works ✅
- Format detection and extraction: Works ✅
/src/components/ultra-color-picker.ts- Complete implementation
- ✅ Maintains backward compatibility
- ✅ Existing configurations continue to work
- ✅ No breaking changes
- ✅ Universal across entire Ultra Card system
- Add eyedropper integration for transparency sampling
- Add preset transparency levels (25%, 50%, 75%)
- Add keyboard shortcuts for transparency adjustment
- Add transparency animation preview
- Implemented in: v2.0-beta13
- Build Status: ✅ Successful
- Date: October 12, 2025
Status: ✅ COMPLETE AND PRODUCTION READY