Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.8.0
-
None
-
Severity 3 - Minor
-
Description
Issue Summary
This is reproducible on Data Center: Yes (Tested internally, Confluence DC 8.8.0)
Trying to set a color scheme item to an RGBA color (for example, RGBA(9, 30, 66, 0.48), as is one of the default values) results in the following error:
Not a valid CSS3 color: RGBA(9, 30, 66, 0.48)
This doesn't appear to happen every time, but it does happen when copy/pasting the value from elsewhere. Since this is the same format RGBA colors are natively saved and displayed by default, more error handling/robust parsing should be implemented to determine which colors are valid. For example, the following regex string should detect and extract the color information from the rgb, rgba, hex, and hex with alpha formats (excluding the CSS named colors):
[rR][gG][bB]\( ?([1-2]?[0-9]?[0-9]), ?([1-2]?[0-9]?[0-9]), ?([1-2]?[0-9]?[0-9]) ?\)|[rR][gG][bB][aA]\( ?([1-2]?[0-9]?[0-9]), ?([1-2]?[0-9]?[0-9]), ?([1-2]?[0-9]?[0-9]), ?(1|0\.[0-9]*) ?\)|#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?
You can test the proposed regex string on Regex101.
Steps to Reproduce
- Navigate to General Configuration > Color Scheme
- Click Edit
- Paste in the string: RGBA(9, 30, 66, 0.48)
- Click Save
Expected Results
The color is saved and shown in the interface.
Actual Results
The user is shown the following error in the web interface:
Not a valid CSS3 color: RGBA(9, 30, 66, 0.48)
Workaround
By editing the text in the field (such as making the RGBA prefix lowercase), Confluence will sometimes accept the value.