On the field settings page, in the Style section, for the "Background Color" and "Border Color" fields, each has a prefix of "#", and each has help text that mentions an example value of "FFFFFF". All of this suggests that the user does not need to include any "#" in the value entered. However, omitting the "#" causes the value to be ignored.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lirantal’s picture

I can confirm the issue.
This happens because the color code is handed out to jQuery's .css() function which hopes to apply a full color code notation, such as "#FF0000" or "rgb()", yet the hex color code is provided without the hash prefix.

While the problem seems at first an issue to add the "#" prefix on hex colors notation due to the input field length limit of 6 characters, the workaround is simply to provide the hex color code short notation, i.e: "#F00".

Attached is a patch to fix the issue. It appends the hash prefix before it hands it out to jQuery's CSS.

lirantal’s picture

Status: Active » Needs review
mjross’s picture

Status: Needs review » Reviewed & tested by the community

The patch worked. Thank you, Liran!