Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-94975

Using an (all caps) RGBA string when setting a color scheme results in an invalid format error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 8.8.0
    • Themes / Theming
    • None

    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

      1. Navigate to General Configuration > Color Scheme
      2. Click Edit
      3. Paste in the string: RGBA(9, 30, 66, 0.48)
      4. 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            439988298593 Atlas Foulks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: