Skip to content

ColorPicker's colorspace not respected for output #11791

@timelsass

Description

@timelsass

Describe the bug
When selecting a colorspace in a ColorPicker component, I would expect that the colorspace is respected for output. It appears things are ran through tinycolor and just out put as RGB for custom colors inline.

To Reproduce
Steps to reproduce the behavior:

  1. Add a paragraph block.
  2. Open the ColorPicker from the ColorPalette.
  3. Change the colorspace to HSL.
  4. Change the background color to some custom color using the control.
  5. Inspect the editor where the background color was changed. Take not that the color was applied in the editor as RGB (despite having selected HSL).
  6. Save and publish the post.

The result is that the background color has now been set to a HEX value on the frontend.

Expected behavior

I expected to see the chosen colorspace respected for frontend (and in-editor) output. In the editor it appears that the colors are all applied as RGB, and the frontend are all applied in HEX.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.1 LTS
  • chrome
  • Version 69.0.3497.92 (Official Build) (64-bit)

Additional context

  • Gutenberg 4.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] ColorsColor management[Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled later[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions