Skip to content

Loading Colors

If you have not reviewed the Getting Started page, please do so to understand the fundamentals of loading data.

The Color entity stores a representation of RGB or Hex Code values for a color. When creating a color, if red, green, and blue values are provided, the equivalent hexadecimal color code is generated. Else, the hexadecimal code must be provided to the hex property.

Required Config Properties

  • loadType: ['COLOR']
  • federatedId
  • name
  • hex and/or red, green, blue

hex and RGB

If the Loader detects values for red, green, and blue columns, they will be used in the load and hex value will be ignored. The system will auto-generate an equivalent hex code based on the RGB values.

Load Example

CSV Data File

This example loads three colors. One with hex and RGB values, one with only hex values, and the other with only RGB.

  • green: its RGB values will be used because they are complete.
  • beige: its hex values will be used because its RGB values are incomplete or missing.
  • black: its RGB values will be used because they are complete.
federatedId,name,Hex,R,G,B
green,Green,#008000,0,128,0
beige,Beige,#f5f5dc,4,,
black,Black,,0,0,0
federatedId name Hex R G B
green Green #008000 0 128 0
beige Beige #f5f5dc 4
black Black 0 0 0

Config YAML / JSON

Please review the Creating a Loader Process to understand how to provide this Config example to the Loader.

loadType:
  - COLOR
federatedMappings:
  federatedId: "colorCode"
  name: "colorName"
  red: "R"
  green: "G"
  blue: "B"
  hex: "Hex"
{
    "loadType": ["COLOR"],
    "federatedMappings": {
        "federatedId": "colorCode",
        "name": "colorName",
        "red": "R",
        "green": "G",
        "blue": "B",
        "hex": "Hex"
    }
}