跳到正文
TakoAPI
返回技能列表

colorkit

由 szpakkamil 提供

Web & Frontend Development
774下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Expert guidance on ColorKit, a Swift library for advanced color manipulation, conversion, and accessibility.

描述

该技能的功能

ColorKit is a Swift library for color manipulation, conversion, and accessibility checking across Apple platforms. It offers a CKColor type that handles color spaces like OKLAB and Display P3, adaptive Light/Dark mode variants, and contrast validation via WCAG and APCA standards.

It combines color space conversion, perceptual gamut mapping, APCA/WCAG contrast checks, and SwiftUI/UIKit bridging in one library, removing the need for separate utilities or manual contrast math.

何时使用

  • Checking APCA contrast ratios for text on custom backgrounds
  • Converting Display P3 wide-gamut colors to sRGB without gamut clipping
  • Creating adaptive hex colors that respond to Light and Dark mode
  • Blending two colors with Multiply or Overlay modes in a design system
  • Persisting brand colors as Codable values across app sessions

示例工作流

输入

User asks: Is my #007AFF label readable on a white background at 16pt regular weight?

智能体
  1. 1

    Initialize CKColor from hex string "#007AFF"

  2. 2

    Reference CKColor.white as the background

  3. 3

    Call isAPCAAccessible(on: background, size: 16, weight: .regular)

  4. 4

    Return the boolean result and explain the APCA threshold for that font size and weight

输出

A boolean indicating whether the color meets APCA contrast requirements, with guidance on adjusting color or font weight if it does not

安装

clawhub install szpakkamil/colorkit

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接