Phenomenon
When applying background colors in Chrome, the color format (hex, rgb, rgba) may vary inconsistently. The same color may be stored in different formats, making it difficult to work with programmatically.
Reproduction example
- Apply yellow background via color picker
- Apply yellow background via text input
- Observe the DOM color values
Observed behavior
- Color format varies:
#ffff00,rgb(255,255,0),rgba(255,255,0,1) - Same color stored in different formats
- Inconsistent color representation
- Difficult to query or modify colors
Expected behavior
- Color format should be consistent
- Or format should be predictable
- Same color should use same format
- Format should be easy to work with
Browser Comparison
- Chrome/Edge: Format varies (this case)
- Firefox: Similar format inconsistency
- Safari: Format handling varies
Notes and possible direction for workarounds
- Normalize color format after application
- Convert all colors to consistent format (e.g., hex or rgba)
- Store original format if needed
- Document color format behavior