{"uid":"cap_q56ACwHh-N6RD00ENcfOJ","slug":"color-mix-srgb-linear-light-blending-619d1ea8","name":"Color Mix (sRGB / Linear Light Blending)","description":"Mix two hex colors at a ratio in sRGB or in linear light (physically correct), returning the blended hex.","url":"https://color-design.x402tookit.com/color-mix?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"First hex color"},"b":{"type":"string","description":"Second hex color"},"space":{"type":"string","description":"srgb (default) or linear"},"weight_b":{"type":"number","description":"Share of b from 0 to 1, default 0.5"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"a":{"type":["null","string"]},"b":{"type":["null","string"]},"asOf":{"type":["null","string"]},"space":{"type":["null","string"]},"result":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"weightOfB":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Q1oRNQRS0ExBocWMYjzyt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Blends two hex colors at a configurable ratio in sRGB or linear light color space, returning the resulting hex color.","exampleAgentPrompt":"Mix hex color #E63946 with #457B9D at a 70/30 ratio — 70% of the second color — using linear light blending, and tell me the resulting hex.","exampleUseCases":[{"title":"UI gradient midpoint computation","prompt":"I'm building a UI gradient between #1A1A2E and #E94560. Can you mix those two colors in sRGB at exactly 50/50 and give me the hex code for the midpoint stop?"},{"title":"Physically correct color blending for data viz","prompt":"For a heatmap I need a perceptually correct blend of #00FF00 and #FF0000 using linear light, weighted 80% toward red. What hex color does that produce?"},{"title":"Brand color tint generation","prompt":"Our brand blue is #003087 and white is #FFFFFF. What hex do I get if I mix them with 25% of the blue and 75% of the white in sRGB?"}],"resultDescription":"Returns a JSON object containing the blended hex color (result), the two input hex colors (a, b), the color space used (space), the blend weight of color B (weightOfB), and a summary string. May also include a source, asOf timestamp, and optional disclaimer or reasons fields.","failureModes":["Invalid hex color format for a or b (missing #, wrong length) — likely 400 error or null result","weight_b outside 0–1 range — may return error or undefined behavior","Unknown color space string — defaults to sRGB or returns error","Missing required query parameters a or b — returns error","Network timeout or service unavailability — no result returned"],"whenToPreferThis":"Choose this endpoint when you need a precise, single blended hex color from two inputs, especially when physical accuracy matters (linear light) or when you need a weighted mix rather than a simple average. Prefer the sibling gradient-steps endpoint if you need multiple interpolated colors across a range.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:12:44.930Z","isFirstParty":false,"canonicalSlug":"color-mix-srgb-linear-light-blending-619d1ea8"}