Color,
Done Right.

Color spaces, blending, and accessibility for Swift.

ColorKit 1.0

ColorKit 1.0: spaces, gamut mapping, blending, accessibility.

Adaptive Semantic Colors

One CKColor holds light, dark, and high-contrast variants. The view picks the right one for the active trait collection.

Light, dark, and high-contrast variants in one color.

Perceptual Gamut Mapping

Convert Display P3 to sRGB through OKLAB. Hue and lightness stay intact when the gamut shrinks.

P3 to sRGB through OKLAB. Hue and lightness intact.

Contrast Checks Built In

Call isAPCAAccessible(on:size:weight:) or the WCAG 2.1 helpers. The result factors in font size and weight.

APCA and WCAG checks for text on a background.

Technical Specs

Eight Color Spaces.

sRGB, Display P3, Adobe RGB, ROMM RGB, CIE L*a*b*, OKLAB, LCH, and CMYK. One CKColor handles them all.

Five Apple Platforms

iOS, macOS, watchOS, tvOS, visionOS from one package.

Perceptual OKLAB

Hue and lightness stay close when colors travel between spaces.

HDR Ready

Extended dynamic range values pass through CKColor untouched.

Capabilities

More Than Conversion.

Blending, contrast, and bridging on top of the color types.

Blending Modes

Multiply, Overlay, Screen, and Soft Light with correct alpha compositing.

Adaptive CKColor

Light, dark, and high-contrast variants resolve at render time.

WCAG 2.1 Contrast

Contrast ratios for text and UI elements against any background.

APCA (WCAG 3)

Perceptual contrast that factors in font size and weight.

UIKit and AppKit

Bridges to UIColor, NSColor, and SwiftUI Color without copies.

Implementation

Add the Package.

Drop in the dependency, build a CKColor, and use it as a ShapeStyle in SwiftUI.

ColorKit is open source under the MIT License.