Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: PickShade color Mix Colors API
version: 1.0.0
description: 'Free color API: parse, convert, contrast (WCAG 2 and APCA), gamut, names, scales, harmonies, mixing, palettes, color blindness and design token export. Color math follows CSS Color 4. No key needed.'
servers:
- url: https://pickshade.com
tags:
- name: Mix Colors
paths:
/api/v1/mix-colors:
get:
operationId: mix_colors_get
summary: Mix two colors
description: Mix two colors at a ratio in a chosen color space, like CSS color-mix(). OKLab keeps the middle bright, sRGB tends to turn gray. Returns the result and a ready color-mix() expression.
responses:
'200':
description: Result
content:
application/json: {}
'400':
description: Invalid input
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: Too many requests. See the Retry-After header
parameters:
- name: first
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 120
description: 'Any color: #ff5733, rgb(255 87 51), hsl(11 100% 60%), oklch(68% 0.21 34), a CSS or common name like navy, or a Tailwind class like sky-500'
- name: second
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 120
description: 'Any color: #ff5733, rgb(255 87 51), hsl(11 100% 60%), oklch(68% 0.21 34), a CSS or common name like navy, or a Tailwind class like sky-500'
- name: amount
in: query
required: false
schema:
default: 50
description: Share of the second color in percent
type: number
minimum: 0
maximum: 100
- name: space
in: query
required: false
schema:
default: oklab
type: string
enum:
- oklab
- oklch
- srgb
- srgb-linear
- lab
- lch
- hsl
- hwb
tags:
- Mix Colors
post:
operationId: mix_colors
summary: Mix two colors
description: Mix two colors at a ratio in a chosen color space, like CSS color-mix(). OKLab keeps the middle bright, sRGB tends to turn gray. Returns the result and a ready color-mix() expression.
requestBody:
required: true
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
first:
type: string
minLength: 1
maxLength: 120
description: 'Any color: #ff5733, rgb(255 87 51), hsl(11 100% 60%), oklch(68% 0.21 34), a CSS or common name like navy, or a Tailwind class like sky-500'
second:
type: string
minLength: 1
maxLength: 120
description: 'Any color: #ff5733, rgb(255 87 51), hsl(11 100% 60%), oklch(68% 0.21 34), a CSS or common name like navy, or a Tailwind class like sky-500'
amount:
default: 50
description: Share of the second color in percent
type: number
minimum: 0
maximum: 100
space:
default: oklab
type: string
enum:
- oklab
- oklch
- srgb
- srgb-linear
- lab
- lch
- hsl
- hwb
required:
- first
- second
example:
first: '#ff5733'
second: '#3b82f6'
amount: 30
space: oklab
responses:
'200':
description: Result
content:
application/json: {}
'400':
description: Invalid input
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: Too many requests. See the Retry-After header
tags:
- Mix Colors
components:
schemas:
Problem:
type: object
properties:
type:
type: string
title:
type: string
status:
type: integer
detail:
type: string