Color spaces and conversions between them

Version on this page:0.1.4
LTS Haskell 22.29:0.3.3
Stackage Nightly 2024-07-19:0.3.3
Latest on Hackage:0.3.3

See all snapshots Color appears in

BSD-3-Clause licensed by Alexey Kuleshevich
Maintained by [email protected]
This version can be pinned in stack with:Color-0.1.4@sha256:bd63ebe43000228a0ce087f2aee91b99d3c5d2a0c8506551ce37dad8eb5e44e8,8070
Used by 1 package in lts-16.11(full list with versions):


Language Travis Coveralls
GitHub top language Travis Coverage Status Join the chat at
Package Hackage Nightly LTS
Color Hackage Nightly Nightly

A library for dealing with Colors and pixels. It implements arbitrary color space conversion, chromatic adaptation and other color manipulations.

There is a clear separation between color models, color spaces and alternative representations of color spaces. All are distinct at the type level. The goal is to prevent mixups of incompatible color types as well as utilize type information for conversion between them.

Currently supported:

  • Color models:

    • Y
    • RGB
    • HSI
    • HSL
    • HSV
    • YCbCr
    • CMYK
  • Color spaces and arbitrary conversions between them:

    • Y - luminance

    • CIE XYZ

    • CIE L*a*b*

    • RGB:

      • sRGB

      • AdobeRGB

      • ITU: Rec470, Rec601 and Rec709

      • Alternative representations:

        • HSI
        • HSL
        • HSV
        • YCbCr
        • CMYK
  • Illuminants:

    • CIE1931 - 2 degree observer
    • CIE1964 - 10 degree observer
    • Some common alternatives
  • Chromatic adaptation:

    • VonKries adaptation with transformations:

      • VonKries
      • Bradford (default)
      • Fairchild
      • CIECAM02
  • Color Standards:

    • RAL

External resources


Changelog for color


  • Export pixelColor
  • Add luma related patterns: PixelY', PixelY'A, Y' and Y'A. Also rgbPixelLuma

  • Fix introduced in 0.1.2 for Alpha cs was incomplete and is fixed in this version without breakage.

0.1.3 (deprecated)

  • Addition of CMCCAT2000.
  • Rename CIECAM02 to CIECAT02 with a fallback synonym for backwards compatibility
  • Fix ColorSpace instance for Alpha cs
  • Add ColorSpace instances for YCbCr cs color spaces that have Luma instance: BT709, BT601_525 and BT601_625


  • Fix YCbCr conversion to derived RGB color spaces
  • Fix conversion of toWord64 (1 :: Double) and toWord632 (1 :: Float).
  • Addition of xyzColorMatchingFunctions and spectralPowerDistributions


  • Addition of Graphics.Color.Illuminant.Wikipedia module
  • Addition of convertColor and convertColorFloat functions


Initial alpha release