> ## Documentation Index
> Fetch the complete documentation index at: https://staging-docs.arcade.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve color clusters

> Lists a pattern's dominant colors, to choose replacements for `recolor`.



## OpenAPI

````yaml /openapi.json post /patterns/refine/recolorClusters
openapi: 3.1.1
info:
  title: Arcade API
  version: '1'
  description: >-
    Generate patterns and order them as manufactured products. Every request is
    a POST with a JSON body.
servers:
  - url: https://platform.arcade.ai/v1
    description: Production
  - url: https://staging-platform.arcade.ai/v1
    description: Staging
security:
  - apiKey: []
tags:
  - name: Patterns
    description: Patterns you generate.
  - name: Refine
    description: Edit, recolor, crop and extend patterns.
  - name: Jobs
    description: Long-running work.
  - name: References
    description: Images that guide generation.
  - name: Models
    description: The models that generate patterns.
  - name: Categories
    description: Product types and their options.
  - name: Products
    description: Products made from your patterns.
  - name: Checkouts
    description: Checkouts for ordering products.
  - name: Orders
    description: Your orders.
paths:
  /patterns/refine/recolorClusters:
    post:
      tags:
        - Refine
      summary: Retrieve color clusters
      description: Lists a pattern's dominant colors, to choose replacements for `recolor`.
      operationId: patterns.refine.recolorClusters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requestId:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: >-
                    Caller-chosen idempotency key; a replay returns the original
                    result
                patternId:
                  type: string
                  minLength: 1
                  description: The pattern to recolor
                clusterCount:
                  type: integer
                  minimum: 2
                  maximum: 20
                  description: >-
                    Omit to let the service choose; recolor must repeat the
                    value
              required:
                - requestId
                - patternId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  clusters:
                    type: array
                    items:
                      type: object
                      properties:
                        clusterId:
                          type: string
                          description: Pass back to recolor with a new color
                        color:
                          type: string
                          pattern: ^#[0-9a-fA-F]{6}$
                          description: The cluster’s current color
                      required:
                        - clusterId
                        - color
                required:
                  - clusters
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key from Settings → API keys in Arcade Studio.

````