# Website Color Palette – Brand Colors, Design Tokens & Tailwind (`gazidev/website-color-palette`) Actor

Extract any website's color palette and design tokens: primary, secondary, accent, background and text colors (HEX, RGB, HSL), CSS variables, fonts, radius, shadows, 50-950 scales, a ready Tailwind v4 theme and CSS variables file, WCAG contrast pairs. Bulk domains, no browser. $2 per 1,000 sites.

- **URL**: https://apify.com/gazidev/website-color-palette.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 site analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website Color Palette – Brand Colors, Design Tokens & Tailwind Theme

Extract any website's **color palette and design tokens** from its real CSS: **primary, secondary, accent, background, surface, text and muted colors** (HEX, RGB and HSL), **CSS custom properties**, **50–950 color scales**, **fonts and font sizes**, **border radius and shadows**, and **WCAG contrast pairs** — plus ready-to-use files: a **Tailwind CSS v4 `@theme`**, a **CSS variables file** and a **design tokens JSON**.

Paste a list of domains and get one row per site. No browser, so it is fast and cheap: **$2 per 1,000 sites**.

### What you can use it for

- **Redesign pitches and mockups** – start a proposal or Figma file in the prospect's own colors and fonts.
- **Clone a brand into a UI kit** – drop the generated Tailwind v4 theme or `:root` variables straight into a project.
- **On-brand marketing assets** – get exact HEX codes and readable text/background pairs for ads, decks and emails.
- **Accessibility checks** – every palette comes with WCAG AA / AAA contrast ratios for its main pairs.
- **Competitor and market research** – compare palettes, typography and design systems across hundreds of sites.
- **AI design tools and agents** – structured design tokens instead of raw HTML or screenshots.

### Output (one row per site)

| Field | What it is |
|---|---|
| `domain`, `finalUrl` | the site and the page that was read after redirects |
| `primary`, `secondary`, `accent`, `background`, `text` | quick HEX values |
| `palette` | `primary`, `secondary`, `accent`, `background`, `surface`, `text`, `muted` – each with `hex`, `rgb`, `hsl`, `usageCount` and how the role was chosen |
| `allColors` | ranked colors with HEX/RGB/HSL, usage, share and roles (background, text, border, button, token) |
| `scales` | 50–950 shades for primary, secondary and accent (OKLCH lightness steps, like Tailwind's palette) |
| `cssVariables` | CSS custom properties with value, category (color, spacing, radius, font, shadow…) and usage count |
| `fonts` | `heading`, `body`, `mono`, Google Fonts, Adobe Fonts flag |
| `fontSizes`, `radius`, `shadows` | most used values |
| `contrastPairs` | `fg`, `bg`, `ratio`, `aa`, `aaLarge`, `aaa` |
| `cssFileUrl`, `tailwindThemeUrl`, `tokensJsonUrl` | links to the generated files in the run's key-value store |
| `tailwindTheme` | the Tailwind v4 theme as text, ready to paste |
| `confidence` | `high`, `medium` or `low` (low = fewer than 3 colors / very little CSS) |
| `blockedBy`, `error` | why a site could not be read (not charged) |

Dataset views: **Palette overview**, **Design tokens**, **WCAG contrast**, **Generated files**.

#### Example (stripe.com, shortened)

```json
{
  "domain": "stripe.com",
  "primary": "#533afd",
  "secondary": "#061b31",
  "accent": "#5d64fe",
  "background": "#ffffff",
  "text": "#1a1a1a",
  "palette": {
    "primary": {"hex": "#533afd", "rgb": [83, 58, 253], "hsl": [248, 98, 61], "usageCount": 53.6},
    "surface": {"hex": "#e5edf5", "rgb": [229, 237, 245], "hsl": [210, 47, 93], "usageCount": 68.0}
  },
  "scales": {"primary": {"50": "#f3f5ff", "500": "#7278ff", "700": "#533afd", "950": "#1b0967", "base": "700"}},
  "fonts": {"heading": "sohne-var", "body": "sohne-var", "mono": "SourceCodePro"},
  "contrastPairs": [{"fg": "#533afd", "bg": "#ffffff", "ratio": 6.19, "aa": true, "aaa": false}],
  "confidence": "high"
}
```

Generated Tailwind v4 file:

```css
@import "tailwindcss";

@theme {
  --color-primary: #533afd;
  --color-background: #ffffff;
  --color-text: #1a1a1a;
  --color-primary-50: #f3f5ff;
  /* … 50–950 for primary, secondary, accent … */
  --font-body: sohne-var, sans-serif;
  --font-mono: SourceCodePro, monospace;
  --radius-sm: 1px;
  /* … radius-md … radius-3xl from the site's most used values … */
  --shadow-1: 0 27px 40.5px -27px rgba(50,50,93,.25),0 16.2px 32.4px -16.2px rgba(0,0,0,.1);
  /* … shadow-2 … shadow-4, most used first … */
}
```

### How it works

1. Fetches the home page (or the URL you give) and **up to 8 of the site's own stylesheets** (2 MB in total), plus inline `<style>` and `style=""` attributes. Third-party CSS (widgets, cookie banners, CSS libraries on public CDNs) is skipped so it does not pollute the palette.
2. Counts every color by where it is used. Button / call-to-action rules weigh most, then headings; code-highlighting themes are ignored. Colors behind `var(--token)` are weighted by how often the token is used. Near-identical shades are merged.
3. Maps colors to roles: the most used colorful colors become primary / secondary / accent (colors the site declares in `theme-color` or its web manifest come first); the most used neutral background becomes `background`; the most used readable text grey becomes `text`.
4. Builds the 50–950 scales in OKLCH (perceptual lightness), computes WCAG 2.x contrast ratios, and writes the files.

### Input

- **Websites** – domains or URLs (`stripe.com`, `https://www.example.com/pricing`).
- **Bulk list** – paste many domains separated by new lines or commas.
- **Domains from a dataset** + **Dataset field** – read sites from another run's dataset (e.g. a lead list with a `website` field).
- **Max brand colours** (8), **Generate 50–950 colour scales** (on), **Generated files** (CSS, Tailwind, JSON), **Include fonts** (on), **Sites in parallel** (10).

```json
{
  "domains": ["stripe.com", "github.com", "notion.so"],
  "outputFiles": ["css", "tailwind", "json"],
  "generateScales": true
}
```

### Pricing

Pay per event: **$0.002 per site analyzed** ($2 per 1,000) plus a tiny start fee. You are **not charged** for sites that are blocked (robots.txt, HTTP 401/403/429…), unreachable, or that have no readable CSS. The generated files are included.

| Actor | Price per site |
|---|---|
| **This Actor** | **$0.002** |
| hydrafetch/website-color-palette-extractor | $0.04 |
| koushikbiswas/site-lens | from $0.02 |
| eiv/website-brand-extractor-pay-per-event | $0.002 |
| eliai/webpage-color-palette | $0.0008 |

Prices as listed in the Apify Store on 12 Nov 2026.

### Limits (honest)

- **No browser.** Sites that build all their styles with JavaScript at runtime (CSS-in-JS, some single-page apps) expose little CSS; those rows get `confidence: "low"` or `"medium"`. Sites with no readable CSS at all are returned as errors and are not charged.
- Colors in images, videos and canvas are not seen – this reads CSS, not pixels.
- Role mapping is a heuristic: on dark-themed sites or sites with many sections, check `allColors` too.
- Respects `robots.txt` (user agent token `WebsiteColorPalette`) and `Crawl-delay`. Sends an honest User-Agent; no proxies. Sites behind bot protection return `blockedBy` and are free.
- Private and internal network addresses are never fetched.

### FAQ

**Does it work with a list of thousands of domains?** Yes – up to 10,000 per run via the list, the bulk text box or a dataset. One row per site.

**Where are the generated files?** In the run's key-value store, named `<domain>-variables.css`, `<domain>-tailwind.css` and `<domain>-tokens.json`. Each row links to them; the Tailwind theme is also inline in `tailwindTheme`.

**What is the tokens JSON format?** The W3C Design Tokens Community Group format (`$value`, `$type`), which Style Dictionary and Figma token plugins can import.

**Do I also get logos and social links?** Use our [Website Brand Kit Extractor](https://apify.com/gazidev/website-brand-extractor) for logos, favicons and social profiles. This Actor focuses on colors and design tokens.

### Use with AI agents (Apify MCP)

Add this Actor to Claude, Cursor or any MCP client through the [Apify MCP server](https://mcp.apify.com) and ask, for example: *"Get the color palette and a Tailwind theme for linear.app and vercel.com."* The structured `palette`, `scales` and `tailwindTheme` fields are ready for an LLM to use without extra parsing.

# Actor input Schema

## `domains` (type: `array`):

Domains or URLs (e.g. `stripe.com` or `https://www.example.com/pricing`). A bare domain becomes `https://domain`. Duplicates are removed. One dataset row per site.

## `bulkText` (type: `string`):

Optional. Paste many domains or URLs separated by new lines, commas or spaces.

## `datasetId` (type: `string`):

Optional. Read domains/URLs from one of your datasets (e.g. the output of a lead scraper). Up to 10,000 values.

## `datasetField` (type: `string`):

Field of the dataset items that holds the domain or URL (e.g. `website`, `url`, `domain`).

## `maxColors` (type: `integer`):

How many colours to return in `allColors` (brand colours plus up to 6 neutrals, most used first).

## `generateScales` (type: `boolean`):

Build Tailwind-style 50–950 shades (OKLCH lightness steps) for the primary, secondary and accent colours. The site's own colour is kept on its nearest step.

## `outputFiles` (type: `array`):

Files saved to the run's key-value store, one set per site; each row links to them. Included in the price.

## `includeFonts` (type: `boolean`):

Heading, body and mono font families plus the most used font sizes.

## `maxConcurrency` (type: `integer`):

How many sites are analyzed at the same time.

## Actor input object example

```json
{
  "domains": [
    "stripe.com",
    "github.com",
    "notion.so"
  ],
  "datasetField": "url",
  "maxColors": 8,
  "generateScales": true,
  "outputFiles": [
    "css",
    "tailwind",
    "json"
  ],
  "includeFonts": true,
  "maxConcurrency": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `tokens` (type: `string`):

No description

## `files` (type: `string`):

No description

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "stripe.com",
        "github.com",
        "notion.so"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/website-color-palette").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "stripe.com",
        "github.com",
        "notion.so",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/website-color-palette").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "stripe.com",
    "github.com",
    "notion.so"
  ]
}' |
apify call gazidev/website-color-palette --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/website-color-palette"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/1GjhaqmmZ0YI2j8PS/builds/RjYVRCndRWe03ih0T/openapi.json
