Skip to content

Instantly share code, notes, and snippets.

View vikingosegundo's full-sized avatar

Manuel Meyer vikingosegundo

  • Groningen, Netherlands
View GitHub Profile
@adamgraham
adamgraham / UIColor+CIEXYZ.swift
Last active May 16, 2024 14:30
An extension of the iOS class UIColor to provide conversion to and from CIE 1931 XYZ colors.
/// An extension to provide conversion to and from CIE 1931 XYZ colors.
extension UIColor {
/// The CIE 1931 XYZ components of a color - luminance (Y) and chromaticity (X,Z).
struct CIEXYZ: Hashable {
/// A mix of cone response curves chosen to be orthogonal to luminance and
/// non-negative, in the range [0, 95.047].
var X: CGFloat
/// The luminance component of the color, in the range [0, 100].