Parse color code

Description

This operation converts a color code in a supported format to other standard color formats.

This operation accepts a color code as input and automatically detects the format. It then returns the equivalent color in the chosen format. If the input format is invalid or cannot be parsed, the operation returns all fields as empty strings instead of an error.


Supported formats

These are the supported formats for your input strings, as well as the formats you can convert them into:

Format
Example

HEX

#ff0000, ff0000

RGB

rgb(255, 0, 0)

RGBA

rgba(255, 0, 0, 1)

HSL

hsl(0, 100%, 50%)

HSLA

hsla(0, 100%, 50%, 1)

CMYK

cmyk(0.00, 1.00, 1.00, 0.00)


Data types

These are the input/output expected data types for this operation:

Input data

- Strings representing the color codes you want to transform.

Output data

- The resulting color codes transformed into multiple formats.


Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a *):

Format color*

Select the format to which you want to convert your input color codes. Choose between:

  • HEX

  • RGB

  • RGBA

  • HSL

  • HSLA

  • CMYK

Refer to the examples in the section above for reference.


Example

Suppose you want to transform your input color codes into a different format:

  1. In your Pipeline, open the required Action configuration and select the input Field.

  2. In the Operation field, choose Parse color code.

  3. Set Format color to RGB.

  4. Give your Output field a name and click Save. The input color codes will be transformed into the chosen format.

For example:

"#ff0000" -> "rgb(255, 0, 0)"

You can try out operations with specific values using the Input field above the operation. You can enter the value in the example above and check the result in the Output field.

Last updated

Was this helpful?