Skip to content

ColorOption

Type: schema

TypeScript Definition

typescript
ColorOption: {{
            /** @description The name of the associated option. */
            name: string;
            /**
             * @description The type of the associated option.
             * @constant
             */
            type: "color";
            value: {
                /**
                 * Format: color-hex
                 * @description The hex code of the color (e.g., #000000).
                 */
                hexcode: string;
                /** @description The name of the color. */
                name: string;
            };
        };
        /**
         * Country
         * @description Country list model
         */
}

OpenAPI Schema

json
{
  "title": "ColorOption",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/ColorOption",
    "description": "API reference for the ColorOption schema"
  },
  "required": [
    "name",
    "type",
    "value"
  ],
  "properties": {
    "name": {
      "description": "The name of the associated option.",
      "type": "string"
    },
    "type": {
      "description": "The type of the associated option.",
      "const": "color"
    },
    "value": {
      "type": "object",
      "properties": {
        "hexcode": {
          "type": "string",
          "description": "The hex code of the color (e.g., #000000).",
          "format": "color-hex",
          "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
        },
        "name": {
          "type": "string",
          "description": "The name of the color."
        }
      },
      "required": [
        "name",
        "hexcode"
      ]
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: