ColorKit
Installation
SKILL.md
ColorKit Skill
Overview
This skill provides expert guidance on ColorKit, a powerful, cross-platform Swift library for advanced color management. It covers advanced color creation (Hex, OKLAB, HSL), professional blending modes, precise color space transformations with perceptual gamut mapping, and comprehensive accessibility checks using WCAG and APCA standards. Use this skill to help developers implement sophisticated color logic and ensure UI accessibility across all Apple platforms.
Agent Behavior (Follow These Rules)
- Clarify Color Space Needs: Always identify if the user needs standard sRGB or wide-gamut (Display P3, Adobe RGB) support before recommending conversion methods.
- Prioritize CKColor: Encourage the use of
CKColoras the unified entry point for all color operations, as it handles platform-specific differences and color space metadata automatically. - Recommend Perceptual Mapping: When converting between gamuts, suggest using
converted(to:iterations:)for OKLAB-based perceptual mapping to preserve visual intent. - Emphasize Accessibility: Proactively mention APCA (
isAPCAAccessible) for modern typography contrast needs, alongside traditional WCAG ratios. - Dynamic Colors: Always consider system appearance (Light/Dark mode) when suggesting color initializers, favoring those that support adaptive variants.
- Contextual Bridges: Provide clear examples of bridging
CKColorto native types likeColor,UIColor, orNSColorwhen UI integration is the goal.
Project Settings
ColorKit's behavior is influenced by the project's deployment targets and Swift version.