Contents

metatronsw/kolor

A library for color spaces and conversions in Swift 5.6+

Supported:

RGB Color Spaces

  • [ sRGB ] ✔︎
  • [ Display P3 ] ✔︎
  • A98 RGB
  • Rec. 2020
  • Rec. 2020 (OETF)
  • ProPhoto RGB
  • Rec. 709
  • Rec. 709 (OETF)
  • Rec. 2100 PQ
  • Rec. 2100 HLG
  • [ Linear sRGB ] ✔︎
  • [ Linear Display P3 ] ✔︎
  • Linear A98 RGB
  • Linear Rec. 2020
  • Linear Rec. 2100
  • Linear ProPhoto RGB

Cylindrical sRGB Spaces

  • [ HSV ] ✔︎
  • [ HSL ] ✔︎
  • HWB
  • HSI
  • Okhsv
  • Okhsl
  • [ OkLCh ] ✔︎
  • [ HSLuv ] ✔︎
  • [ HPLuv ] ✔︎
  • Cubehelix

XYZ Spaces

  • [ XYZ D65 ] ✔︎
  • [ XYZ D50 ] ✔︎

Lab Like Spaces

  • [ Lab D50 ] ✔︎
  • [ Lab D65 ] ✔︎
  • [ Oklab ] ✔︎
  • Oklrab
  • [ Luv ] ✔︎
  • [ DIN99o ] ✔︎
  • Jzazbz
  • Hunter Lab
  • RLAB
  • IPT
  • ICtCp
  • IgPgTg
  • CAM02 UCS
  • CAM02 SCD
  • CAM02 LCD
  • CAM16 UCS in progress...
  • CAM16 SCD
  • CAM16 LCD
  • XYB

LCh Like Spaces

  • [ LCh D50 ] ✔︎
  • [ LCh D65 ] ✔︎
  • OkLCh
  • OkLrCh
  • LCh(uv)
  • DIN99 LCh
  • JzCzhz
  • CAM02 JMh
  • CAM16 JMh
  • Hellwig JMh
  • HCT
  • ZCAM JMh

ACES Spaces

  • ACES 2065-1
  • ACEScg
  • ACEScc
  • ACEScct

Miscellaneous Spaces

  • [ xyY ] ✔︎
  • CIE 1960 UCS
  • RYB
  • CMY
  • [ CMYK ] ✔︎
  • oRGB
  • Prismatic

======

sRGB › RGB

RGB › XYZ, HSV, HSL, OKLAB, OKLCH, YUV, CMYK

XYZ › xyY, UV, LAB, LUV, CAM16

LUV › LCh › HSLuv / HPLuv

======

The various components and formulas were gathered from multiple sources and rewritten from:

1 Copyright (c) Lucas Beyer - https://github.com/lucasb-eyer/go-colorful 2 Copyright (c) Artur Torun (a.k.a. Mojzesh) - https://github.com/mojzesh/swift-colorful 3 Copyright (c) HSLuv Project - https://github.com/hsluv/hsluv-swift 4 Copyright (c) Delta E (CIE 2000) - http://www.brucelindbloom.com/index.html?ColorDifferenceCalc.html

The other components are translated from C, C++, C#, Python, and JavaScript libraries. The add-ons and helper functions were written directly into the library, with many useful and well-known functions adapted to the project.

Package Metadata

Repository: metatronsw/kolor

Default branch: main

README: README.md