Color Utilities

Hex To Hsv

Converts hex color codes to HSV (Hue, Saturation, Value) format with precise mathematical accuracy. Access via MCP in Cursor or Windsurf for AI-assisted color workflows, or REST at `/v1/color/hex-to-hsv`. Example: `#FF5733` returns `{h: 14, s: 80, v: 100}`. Perfect for design systems and color manipulation tasks.

API Endpoint

GET /v1/color/hex-to-hsv

Code Examples

curl "https://tinyfn.io/v1/color/hex-to-hsv" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/hex-to-hsv', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/color/hex-to-hsv',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's color tools:

{
  "mcpServers": {
    "tinyfn-color": {
      "url": "https://tinyfn.io/mcp/color",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What HSV format does hex-to-hsv return?

Returns an object with `h` (hue 0-360°), `s` (saturation 0-100%), and `v` (value/brightness 0-100%). All values are rounded to integers for practical use.

How do I use hex-to-hsv in MCP tools like Cursor?

Call the tool with any valid hex color code. Works with 3-digit (#RGB), 6-digit (#RRGGBB), and both with/without the hash prefix.

Does hex-to-hsv handle invalid hex colors?

Yes, it validates input and returns clear error messages for malformed hex codes. Only accepts valid hex color formats.

What's the difference between HSV and HSL color spaces?

HSV uses Value (brightness) while HSL uses Lightness. HSV is preferred for color pickers and design tools because it matches human color perception better.

Can I convert multiple hex colors to HSV at once?

This endpoint processes one color per request. For batch conversions, make multiple API calls or use it iteratively in your MCP-enabled AI workflow.

Try Hex To Hsv Now

Get your free API key and start using Hex To Hsv in seconds.

Get Free API Key