-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Color spaces and conversions between them -- -- Please see the README on GitHub at -- https://github.com/lehins/Color#readme @package Color @version 0.3.0 module Graphics.Color.Algebra.Binary -- | Under the hood, binary pixels are backed by Word8, but can only -- take values of 0 or 1. Use zero/one to -- construct a bit and on/off to construct a binary -- pixel. data Bit zero :: Bit one :: Bit -- | Convert Bit to Bool toBool :: Bit -> Bool -- | Convert Bool to Bit fromBool :: Bool -> Bit -- | Convert a bit to a number. toNum :: Num a => Bit -> a -- | Convert a number to a bit. Any non-zero number corresponds to -- 1. fromNum :: (Eq a, Num a) => a -> Bit instance Foreign.Storable.Storable Graphics.Color.Algebra.Binary.Bit instance GHC.Classes.Eq Graphics.Color.Algebra.Binary.Bit instance GHC.Classes.Ord Graphics.Color.Algebra.Binary.Bit instance GHC.Show.Show Graphics.Color.Algebra.Binary.Bit instance Data.Bits.Bits Graphics.Color.Algebra.Binary.Bit instance Graphics.Color.Algebra.Elevator.Elevator Graphics.Color.Algebra.Binary.Bit instance GHC.Num.Num Graphics.Color.Algebra.Binary.Bit instance Data.Vector.Unboxed.Base.Unbox Graphics.Color.Algebra.Binary.Bit instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Graphics.Color.Algebra.Binary.Bit instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Graphics.Color.Algebra.Binary.Bit module Graphics.Color.Algebra -- | A 2D vector with x and y coordinates. data V2 a V2 :: !a -> !a -> V2 a -- | A 3D vector with x, y and z coordinates. data V3 a V3 :: !a -> !a -> !a -> V3 a showV3 :: Show a => V3 a -> String -- | Mulitply a 1x3 vector by a 3x1 vector, i.e. dot product. dotProduct :: Num a => V3 a -> V3 a -> a -- | A 3x3 Matrix data M3x3 a M3x3 :: {-# UNPACK #-} !V3 a -> {-# UNPACK #-} !V3 a -> {-# UNPACK #-} !V3 a -> M3x3 a [m3x3row0] :: M3x3 a -> {-# UNPACK #-} !V3 a [m3x3row1] :: M3x3 a -> {-# UNPACK #-} !V3 a [m3x3row2] :: M3x3 a -> {-# UNPACK #-} !V3 a showM3x3 :: Show a => M3x3 a -> String -- | Compute a determinant of a 3x3 matrix. detM3x3 :: Num a => M3x3 a -> a -- | Invert a 3x3 matrix. invertM3x3 :: Fractional a => M3x3 a -> M3x3 a -- | Mulitply a 3x3 matrix by a 3x1 vector, while getting a vector back. multM3x3byV3 :: Num a => M3x3 a -> V3 a -> V3 a multM3x3byM3x3 :: Num a => M3x3 a -> M3x3 a -> M3x3 a -- | Multiply a 3x3 matrix by another 3x3 diagonal matrix represented by a -- 1x3 vector multM3x3byV3d :: Num a => M3x3 a -> V3 a -> M3x3 a transposeM3x3 :: M3x3 a -> M3x3 a -- | A class with a set of functions that allow for changing precision by -- shrinking and streatching the values. class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e maxValue :: Elevator e => e minValue :: Elevator e => e fieldFormat :: Elevator e => e -> FieldFormat -- | This is a pretty printer for the value. toShowS :: Elevator e => e -> ShowS -- | This is a pretty printer for the value. toShowS :: (Elevator e, PrintfArg e) => e -> ShowS -- | Values are scaled to [0, 255] range. toWord8 :: Elevator e => e -> Word8 -- | Values are scaled to [0, 65535] range. toWord16 :: Elevator e => e -> Word16 -- | Values are scaled to [0, 4294967295] range. toWord32 :: Elevator e => e -> Word32 -- | Values are scaled to [0, 18446744073709551615] range. toWord64 :: Elevator e => e -> Word64 -- | Values are scaled to [0.0, 1.0] range. toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a -- | Values are scaled from [0.0, 1.0] range. fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e -- | Values are scaled to [0.0, 1.0] range. toFloat :: Elevator e => e -> Float -- | Values are scaled to [0.0, 1.0] range. toDouble :: Elevator e => e -> Double -- | Values are scaled from [0.0, 1.0] range. fromDouble :: Elevator e => Double -> e -- | Division that works for integral types as well as floating points. May -- throw an exception. (//) :: Elevator e => e -> e -> e infixl 7 // -- | Clamp a value to [0, 1] range. clamp01 :: RealFloat a => a -> a showsType :: Typeable t => proxy t -> ShowS asProxy :: p -> (Proxy p -> t) -> t instance GHC.Classes.Ord a => GHC.Classes.Ord (Graphics.Color.Algebra.V2 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Graphics.Color.Algebra.V2 a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Graphics.Color.Algebra.V3 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Graphics.Color.Algebra.V3 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Graphics.Color.Algebra.M3x3 a) instance Graphics.Color.Algebra.Elevator.Elevator a => GHC.Show.Show (Graphics.Color.Algebra.M3x3 a) instance GHC.Base.Functor Graphics.Color.Algebra.M3x3 instance GHC.Base.Applicative Graphics.Color.Algebra.M3x3 instance Data.Foldable.Foldable Graphics.Color.Algebra.M3x3 instance Data.Traversable.Traversable Graphics.Color.Algebra.M3x3 instance GHC.Num.Num a => GHC.Num.Num (Graphics.Color.Algebra.M3x3 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Graphics.Color.Algebra.M3x3 a) instance GHC.Float.Floating a => GHC.Float.Floating (Graphics.Color.Algebra.M3x3 a) instance Graphics.Color.Algebra.Elevator.Elevator a => GHC.Show.Show (Graphics.Color.Algebra.V3 a) instance GHC.Base.Functor Graphics.Color.Algebra.V3 instance GHC.Base.Applicative Graphics.Color.Algebra.V3 instance Data.Foldable.Foldable Graphics.Color.Algebra.V3 instance Data.Traversable.Traversable Graphics.Color.Algebra.V3 instance GHC.Num.Num a => GHC.Num.Num (Graphics.Color.Algebra.V3 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Graphics.Color.Algebra.V3 a) instance GHC.Float.Floating a => GHC.Float.Floating (Graphics.Color.Algebra.V3 a) instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Algebra.V3 e) instance Graphics.Color.Algebra.Elevator.Elevator a => GHC.Show.Show (Graphics.Color.Algebra.V2 a) instance GHC.Base.Functor Graphics.Color.Algebra.V2 instance GHC.Base.Applicative Graphics.Color.Algebra.V2 instance Data.Foldable.Foldable Graphics.Color.Algebra.V2 instance Data.Traversable.Traversable Graphics.Color.Algebra.V2 instance GHC.Num.Num a => GHC.Num.Num (Graphics.Color.Algebra.V2 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Graphics.Color.Algebra.V2 a) instance GHC.Float.Floating a => GHC.Float.Floating (Graphics.Color.Algebra.V2 a) instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Algebra.V2 e) module Graphics.Color.Model class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS data Alpha cs type family Opaque cs -- | Add an alpha channel value to an opaque pixel addAlpha :: Color cs e -> e -> Color (Alpha cs) e -- | Get the alpha channel value for the pixel getAlpha :: Color (Alpha cs) e -> e -- | Change the alpha channel value for the pixel setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e -- | Get the opaque pixel value, while leaving alpha channel intact. dropAlpha :: Color (Alpha cs) e -> Color cs e -- | Change the alpha channel value for the pixel modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e -- | Change the opaque pixel value, while leaving alpha channel intact. modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e -- | A color with a single channel, most likely luminance data X -- | Constructor for X pattern ColorX :: e -> Color X e -- | Constructor for X with alpha channel. pattern ColorXA :: e -> e -> Color (Alpha X) e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type -- | Weights imposed on individual channels of a 3-component color newtype Weights e Weights :: V3 e -> Weights e [unWeights] :: Weights e -> V3 e -- | Convert an RGB color model to a single channel by using the supplied -- weights rgb2y :: forall e e'. (Elevator e', Elevator e, RealFloat e) => Color RGB e' -> Weights e -> Color X e -- | The most common RGB color model data RGB -- | Constructor for RGB with alpha channel. pattern ColorRGB :: e -> e -> e -> Color RGB e -- | Constructor for RGB with alpha channel. pattern ColorRGBA :: e -> e -> e -> e -> Color (Alpha RGB) e pattern RGB :: () => V3 e -> Color RGB e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS -- | Hue, Saturation and Intensity color model. data HSI -- | Constructor for HSI. pattern ColorHSI :: e -> e -> e -> Color HSI e -- | Constructor for HSI with alpha channel. pattern ColorHSIA :: e -> e -> e -> e -> Color (Alpha HSI) e -- | Constructor for an HSI color model. Difference from ColorHSI is -- that channels are restricted to Double and the hue is specified -- in 0 to 360 degree range, rather than 0 to 1. Note, that this is not -- checked. pattern ColorH360SI :: Fractional e => e -> e -> e -> Color HSI e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS hsi2rgb :: (Ord e, Floating e) => Color HSI e -> Color RGB e rgb2hsi :: RealFloat e => Color RGB e -> Color HSI e -- | Hue, Saturation and Luminance (Lightness) color model. data HSL -- | Constructor for HSL. pattern ColorHSL :: e -> e -> e -> Color HSL e -- | Constructor for HSL with alpha channel. pattern ColorHSLA :: e -> e -> e -> e -> Color (Alpha HSL) e -- | Constructor for an HSL color model. Difference from ColorHSL is -- that channels are restricted to Double and the hue is specified -- in 0 to 360 degree range, rather than 0 to 1. Note, that this is not -- checked. pattern ColorH360SL :: Fractional e => e -> e -> e -> Color HSL e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS hc2rgb :: RealFrac e => e -> e -> Color RGB e hsl2rgb :: RealFrac e => Color HSL e -> Color RGB e rgb2hsl :: (Ord e, Floating e) => Color RGB e -> Color HSL e -- | Hue, Saturation and Value (Brightness) color model. data HSV -- | Constructor for HSV. pattern ColorHSV :: e -> e -> e -> Color HSV e -- | Constructor for HSV with alpha channel. pattern ColorHSVA :: e -> e -> e -> e -> Color (Alpha HSV) e -- | Constructor for an HSV color model. Difference from ColorHSV is -- that channels are restricted to Double and the hue is specified -- in 0 to 360 degree range, rather than 0 to 1. Note, that this is not -- checked. pattern ColorH360SV :: Fractional e => e -> e -> e -> Color HSV e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS hc2rgb :: RealFrac e => e -> e -> Color RGB e hsv2rgb :: RealFrac e => Color HSV e -> Color RGB e rgb2hsv :: (Ord e, Fractional e) => Color RGB e -> Color HSV e -- | Constructor for an RGB color model in an alternative YCbCr color model pattern ColorYCbCr :: e -> e -> e -> Color YCbCr e -- | Constructor for YCbCr with alpha channel. pattern ColorYCbCrA :: e -> e -> e -> e -> Color (Alpha YCbCr) e -- | YCbCr color model data YCbCr -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type rgb2ycbcr :: (Elevator e', Elevator e, RealFloat e) => Color RGB e' -> Weights e -> Color YCbCr e ycbcr2rgb :: (Elevator e', Elevator e, RealFloat e) => Color YCbCr e' -> Weights e -> Color RGB e data CMYK pattern ColorCMYK :: () => !e -> !e -> !e -> !e -> Color CMYK e -- | Constructor for CMYK with alpha channel. pattern ColorCMYKA :: e -> e -> e -> e -> e -> Color (Alpha CMYK) e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where { type family Components cs e :: Type; } -- | Convert a Color to a representation suitable for storage as an unboxed -- element, usually a tuple of channels. toComponents :: ColorModel cs e => Color cs e -> Components cs e -- | Convert from an elemnt representation back to a Color. fromComponents :: ColorModel cs e => Components cs e -> Color cs e -- | Display the cs portion of the pixel. Color itself will not be -- evaluated. showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS cmyk2rgb :: (RealFloat e, Elevator e) => Color CMYK e -> Color RGB e rgb2cmyk :: (RealFloat e, Elevator e) => Color RGB e -> Color CMYK e -- | A Color family with a color space and a precision of elements. data family Color cs e :: Type -- | A class with a set of functions that allow for changing precision by -- shrinking and streatching the values. class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e maxValue :: Elevator e => e minValue :: Elevator e => e fieldFormat :: Elevator e => e -> FieldFormat -- | This is a pretty printer for the value. toShowS :: Elevator e => e -> ShowS -- | This is a pretty printer for the value. toShowS :: (Elevator e, PrintfArg e) => e -> ShowS -- | Values are scaled to [0, 255] range. toWord8 :: Elevator e => e -> Word8 -- | Values are scaled to [0, 65535] range. toWord16 :: Elevator e => e -> Word16 -- | Values are scaled to [0, 4294967295] range. toWord32 :: Elevator e => e -> Word32 -- | Values are scaled to [0, 18446744073709551615] range. toWord64 :: Elevator e => e -> Word64 -- | Values are scaled to [0.0, 1.0] range. toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a -- | Values are scaled from [0.0, 1.0] range. fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e -- | Values are scaled to [0.0, 1.0] range. toFloat :: Elevator e => e -> Float -- | Values are scaled to [0.0, 1.0] range. toDouble :: Elevator e => e -> Double -- | Values are scaled from [0.0, 1.0] range. fromDouble :: Elevator e => Double -> e -- | Division that works for integral types as well as floating points. May -- throw an exception. (//) :: Elevator e => e -> e -> e infixl 7 // -- | Clamp a value to [0, 1] range. clamp01 :: RealFloat a => a -> a module Graphics.Color.Space.CIE1976.LAB pattern LAB :: () => V3 e -> Color (LAB i) e pattern ColorLAB :: e -> e -> e -> Color (LAB i) e -- | Constructor for LAB with alpha channel. pattern ColorLABA :: e -> e -> e -> e -> Color (Alpha (LAB i)) e -- | CIE L*a*b* color space data LAB (i :: k) instance forall k e (i :: k). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i) e) instance forall k e (i :: k). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i) e) instance forall k (i :: k). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i)) instance forall k (i :: k). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i)) instance forall k (i :: k). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i)) instance forall k (i :: k). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i)) instance forall k e (i :: k). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i) e) instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1976.LAB.LAB i) e) instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.CIE1976.LAB.LAB i) e instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e, GHC.Float.RealFloat e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.CIE1976.LAB.LAB i) i e module Graphics.Color.Space.CIE1931.XYZ -- | Constructor for the most common XYZ color space pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e -- | The original color space CIE 1931 XYZ color space data XYZ i module Graphics.Color.Illuminant.Wikipedia -- | 2° observer Standard Illuminants listed on Wikipedia. Despite -- the fact that they have slightly different chromaticity coordinates -- than the actual CIE1931 standard papers, these are very commmonly used -- values. For better interoperability it is better to use the actual -- CIE1931 illuminants. data Degree2 -- | Incandescent / Tungsten A :: Degree2 -- | Direct sunlight at noon (obsolete) B :: Degree2 -- | Average / North sky Daylight (obsolete) C :: Degree2 -- | Horizon Light. D50 :: Degree2 -- | Mid-morning / Mid-afternoon Daylight D55 :: Degree2 -- | Noon Daylight D65 :: Degree2 -- | Overcast dayligh / North sky Daylight D75 :: Degree2 -- | Equal energy E :: Degree2 -- | Daylight Fluorescent F1 :: Degree2 -- | The fluorescent illuminant in most common use, represents cool white -- fluorescent (4100° Kelvin, CRI 60). Non-standard names include F, F02, -- Fcw, CWF, CWF2. -- -- Note - Takes precedence over other F illuminants F2 :: Degree2 -- | White Fluorescent F3 :: Degree2 -- | Warm White Fluorescent F4 :: Degree2 -- | Daylight Fluorescent F5 :: Degree2 -- | Lite White Fluorescent F6 :: Degree2 -- | Represents a broadband fluorescent lamp, which approximates CIE -- illuminant D65 (6500° Kelvin, CRI 90). -- -- Note - Takes precedence over other F illuminants F7 :: Degree2 -- | D50 simulator, Sylvania F40 Design 50 (F40DSGN50) F8 :: Degree2 -- | Cool White Deluxe Fluorescent F9 :: Degree2 -- | Philips TL85, Ultralume 50 F10 :: Degree2 -- | Philips TL84, SP41, Ultralume 40 -- -- Represents a narrow tri-band fluorescent of 4000° Kelvin color -- temperature, CRI 83. -- -- Note - Takes precedence over other F illuminants F11 :: Degree2 -- | Philips TL83, Ultralume 30 F12 :: Degree2 instance GHC.Enum.Bounded Graphics.Color.Illuminant.Wikipedia.Degree2 instance GHC.Enum.Enum Graphics.Color.Illuminant.Wikipedia.Degree2 instance GHC.Read.Read Graphics.Color.Illuminant.Wikipedia.Degree2 instance GHC.Show.Show Graphics.Color.Illuminant.Wikipedia.Degree2 instance GHC.Classes.Eq Graphics.Color.Illuminant.Wikipedia.Degree2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.A instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.B instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.C instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.D50 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.D55 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.D65 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.D75 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.E instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F1 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F3 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F4 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F5 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F6 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F7 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F8 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F9 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F10 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F11 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.Wikipedia.F12 module Graphics.Color.Illuminant.ITU.Rec601 -- | Whitepoint D65 that is so commonly used for sRGB and other color -- spaces defined by ITU: Rec.601 (525 and 625) and Rec.709 standards. It -- is slightly different than D65 that is defined by CIE1931 and -- D65 specified in Rec.470. -- --
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance Graphics.Color.Space.Internal.Illuminant Graphics.Color.Illuminant.ITU.Rec601.D65
module Graphics.Color.Illuminant.ITU.Rec470
-- | Whitepoint C that is used for ITU: Rec.470 (525). It is slightly
-- different than C that is defined by CIE1931, thus a separate
-- declaration in here.
--
--
-- >>> whitePoint :: WhitePoint C Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * C:( 0.31000000, 0.31600000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ C) Float
-- <XYZ * C:( 0.98101264, 1.00000000, 1.18354420)>
--
-- >>> colorTemperature :: CCT C
-- CCT {unCCT = 6774.0}
--
data C
-- | Whitepoint D65 that is used for ITU: Rec.470 (625). It is slightly
-- different than D65 that is defined by CIE1931 and D65
-- specified in Rec.601, thus a separate declaration in here.
--
--
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31300000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95136780, 1.00000000, 1.08814610)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance Graphics.Color.Space.Internal.Illuminant Graphics.Color.Illuminant.ITU.Rec470.D65
instance Graphics.Color.Space.Internal.Illuminant Graphics.Color.Illuminant.ITU.Rec470.C
module Graphics.Color.Illuminant.ICC.PCS
-- | This is an approximation of CIE1931 D50 white point defined in
-- ICC PCS. Useful for chromatic adaptation.
--
--
-- >>> whitePoint :: WhitePoint D50 Double
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D50:( 0.3457029149190000, 0.3585385966800000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D50) Float
-- <XYZ * D50:( 0.96420000, 1.00000000, 0.82490010)>
--
-- >>> colorTemperature :: CCT D50
-- CCT {unCCT = 5003.0}
--
data D50
instance Graphics.Color.Space.Internal.Illuminant Graphics.Color.Illuminant.ICC.PCS.D50
module Graphics.Color.Illuminant.CIE1931
-- | CIE 1931 2° observer illuminants
--
-- References:
--
-- -- [(λ, V3 x̄(λ) ȳ(λ) z̄(λ), V2 x(λ) z(λ))] ---- -- All of the values were taken directly from: CIE15: Technical -- Report: Colorimetry, 3rd edition -- xyzColorMatchingFunctions :: [(Double, V3 Double, V2 Double)] -- | Planckian constant has changed over the years, this function adjusts -- for that fact. rectifyColorTemperature :: Int -> Double -> CCT (i :: k) -- | Deprecated: In favor of spectralPowerDistributions wavelengths :: [(Double, V3 Double)] instance GHC.Enum.Bounded Graphics.Color.Illuminant.CIE1931.CIE1931 instance GHC.Enum.Enum Graphics.Color.Illuminant.CIE1931.CIE1931 instance GHC.Read.Read Graphics.Color.Illuminant.CIE1931.CIE1931 instance GHC.Show.Show Graphics.Color.Illuminant.CIE1931.CIE1931 instance GHC.Classes.Eq Graphics.Color.Illuminant.CIE1931.CIE1931 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.A instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.B instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.C instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.D50 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.D55 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.D60 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.D65 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.D75 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.E instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL1 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL4 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL5 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL6 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL7 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL8 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL9 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL10 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL11 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL12 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_1 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_3 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_4 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_5 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_6 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_7 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_8 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_9 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_10 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_11 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_12 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_13 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_14 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.FL3_15 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.HP1 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.HP2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.HP3 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.HP4 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1931.HP5 module Graphics.Color.Illuminant.CIE1964 -- | CIE 1964 10° observer illuminants -- -- References: -- -- data CIE1964 -- | Incandescent / Tungsten A :: CIE1964 -- | Direct sunlight at noon (obsolete) B :: CIE1964 -- | Average / North sky Daylight (obsolete) C :: CIE1964 -- | Horizon Light. D50 :: CIE1964 -- | Mid-morning / Mid-afternoon Daylight D55 :: CIE1964 D60 :: CIE1964 -- | Noon Daylight D65 :: CIE1964 -- | Overcast dayligh / North sky Daylight D75 :: CIE1964 -- | Equal energy E :: CIE1964 -- | Daylight Fluorescent FL1 :: CIE1964 -- | The fluorescent illuminant in most common use, represents cool white -- fluorescent (4100° Kelvin, CRI 60). Non-standard names include F, F02, -- Fcw, CWF, CWF2. -- -- Note - Takes precedence over other F illuminants FL2 :: CIE1964 -- | White Fluorescent FL3 :: CIE1964 -- | Warm White Fluorescent FL4 :: CIE1964 -- | Daylight Fluorescent FL5 :: CIE1964 -- | Lite White Fluorescent FL6 :: CIE1964 -- | Represents a broadband fluorescent lamp, which approximates CIE -- illuminant D65 (6500° Kelvin, CRI 90). -- -- Note - Takes precedence over other F illuminants FL7 :: CIE1964 -- | D50 simulator, Sylvania F40 Design 50 (F40DSGN50) FL8 :: CIE1964 -- | Cool White Deluxe Fluorescent FL9 :: CIE1964 -- | Philips TL85, Ultralume 50 FL10 :: CIE1964 -- | Philips TL84, SP41, Ultralume 40 -- -- Represents a narrow tri-band fluorescent of 4000° Kelvin color -- temperature, CRI 83. -- -- Note - Takes precedence over other F illuminants FL11 :: CIE1964 -- | Philips TL83, Ultralume 30 FL12 :: CIE1964 instance GHC.Enum.Bounded Graphics.Color.Illuminant.CIE1964.CIE1964 instance GHC.Enum.Enum Graphics.Color.Illuminant.CIE1964.CIE1964 instance GHC.Read.Read Graphics.Color.Illuminant.CIE1964.CIE1964 instance GHC.Show.Show Graphics.Color.Illuminant.CIE1964.CIE1964 instance GHC.Classes.Eq Graphics.Color.Illuminant.CIE1964.CIE1964 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.A instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.B instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.C instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.D50 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.D55 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.D60 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.D65 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.D75 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.E instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL1 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL2 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL3 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL4 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL5 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL6 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL7 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL8 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL9 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL10 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL11 instance Graphics.Color.Space.Internal.Illuminant 'Graphics.Color.Illuminant.CIE1964.FL12 module Graphics.Color.Space.RGB.ITU.Rec470 pattern BT470_525 :: () => Color RGB e -> Color (BT470_525 l) e -- | ITU-R BT.470 (525) color space. Used in NTSC data BT470_525 (l :: Linearity) -- | Whitepoint C that is used for ITU: Rec.470 (525). It is slightly -- different than C that is defined by CIE1931, thus a separate -- declaration in here. -- --
-- >>> whitePoint :: WhitePoint C Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * C:( 0.31000000, 0.31600000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ C) Float
-- <XYZ * C:( 0.98101264, 1.00000000, 1.18354420)>
--
-- >>> colorTemperature :: CCT C
-- CCT {unCCT = 6774.0}
--
data C
pattern BT470_625 :: () => Color RGB e -> Color (BT470_625 l) e
-- | ITU-R BT.470 (625) color space. Used in PAL/SECAM
data BT470_625 (l :: Linearity)
-- | Whitepoint D65 that is used for ITU: Rec.470 (625). It is slightly
-- different than D65 that is defined by CIE1931 and D65
-- specified in Rec.601, thus a separate declaration in here.
--
--
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31300000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95136780, 1.00000000, 1.08814610)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) e)
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec470.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec470.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 Graphics.Color.Illuminant.ITU.Rec470.D65
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec470.C e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec470.C e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 Graphics.Color.Illuminant.ITU.Rec470.C
module Graphics.Color.Space.RGB.Alternative.HSV
-- | Constructor for an RGB color space in an alternative HSV color model
pattern ColorHSV :: e -> e -> e -> Color (HSV cs) e
-- | Constructor for HSV with alpha channel.
pattern ColorHSVA :: e -> e -> e -> e -> Color (Alpha (HSV cs)) e
-- | Constructor for an RGB color space in an alternative HSV color model.
-- Difference from ColorHSV is that the hue is specified in 0 to
-- 360 degree range, rather than 0 to 1. Note, that this is not checked.
pattern ColorH360SV :: Fractional e => e -> e -> e -> Color (HSV cs) e
-- | HSV representation for some (RedGreenBlue cs i)
-- color space
data HSV cs
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
instance forall k e (cs :: k). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs) e)
instance forall k e (cs :: k). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs) e)
instance forall k (cs :: k). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs))
instance forall k (cs :: k). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs))
instance forall k (cs :: k). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs))
instance forall k (cs :: k). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs))
instance forall k e (cs :: k). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Alternative.HSV.HSV cs) e
instance forall k (cs :: Graphics.Color.Space.RGB.Internal.Linearity -> *) (l :: Graphics.Color.Space.RGB.Internal.Linearity) (i :: k) e. (Graphics.Color.Space.Internal.ColorSpace (cs l) i e, Graphics.Color.Space.RGB.Internal.RedGreenBlue cs i) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.HSV.HSV (cs l)) i e
module Graphics.Color.Space.RGB.Alternative.HSL
-- | Constructor for an RGB color space in an alternative HSL color model
pattern ColorHSL :: e -> e -> e -> Color (HSL cs) e
-- | Constructor for HSL with alpha channel.
pattern ColorHSLA :: e -> e -> e -> e -> Color (Alpha (HSL cs)) e
-- | Constructor for an RGB color space in an alternative HSL color model.
-- Difference from ColorHSL is that the hue is specified in 0 to
-- 360 degree range, rather than 0 to 1. Note, that this is not checked.
pattern ColorH360SL :: Fractional e => e -> e -> e -> Color (HSL cs) e
-- | HSL representation for some (RedGreenBlue cs i)
-- color space
data HSL cs
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
instance forall k e (cs :: k). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs) e)
instance forall k e (cs :: k). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs) e)
instance forall k (cs :: k). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs))
instance forall k (cs :: k). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs))
instance forall k (cs :: k). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs))
instance forall k (cs :: k). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs))
instance forall k e (cs :: k). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Alternative.HSL.HSL cs) e
instance forall k (cs :: Graphics.Color.Space.RGB.Internal.Linearity -> *) (l :: Graphics.Color.Space.RGB.Internal.Linearity) (i :: k) e. (Graphics.Color.Space.Internal.ColorSpace (cs l) i e, Graphics.Color.Space.RGB.Internal.RedGreenBlue cs i) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.HSL.HSL (cs l)) i e
module Graphics.Color.Space.RGB.Alternative.HSI
-- | Constructor for an RGB color space in an alternative HSI color model
pattern ColorHSI :: e -> e -> e -> Color (HSI cs) e
-- | Constructor for HSI with alpha channel.
pattern ColorHSIA :: e -> e -> e -> e -> Color (Alpha (HSI cs)) e
-- | Constructor for an RGB color space in an alternative HSI color model.
-- Difference from ColorHSI is that the hue is specified in 0 to
-- 360 degree range, rather than 0 to 1. Note, that this is not checked.
pattern ColorH360SI :: Fractional e => e -> e -> e -> Color (HSI cs) e
-- | HSI representation for some (RedGreenBlue cs i)
-- color space
data HSI cs
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
instance forall k e (cs :: k). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs) e)
instance forall k e (cs :: k). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs) e)
instance forall k (cs :: k). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs))
instance forall k (cs :: k). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs))
instance forall k (cs :: k). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs))
instance forall k (cs :: k). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs))
instance forall k e (cs :: k). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Alternative.HSI.HSI cs) e
instance forall k (cs :: Graphics.Color.Space.RGB.Internal.Linearity -> *) (l :: Graphics.Color.Space.RGB.Internal.Linearity) (i :: k) e. (Graphics.Color.Space.Internal.ColorSpace (cs l) i e, Graphics.Color.Space.RGB.Internal.RedGreenBlue cs i) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.HSI.HSI (cs l)) i e
module Graphics.Color.Space.CIE1931.RGB
-- | The original CIE1931 RGB color space with an arbitrary
-- illuminant
data CIERGB (l :: Linearity)
-- | CIE RGB does not utilize any gamma function, therefore it is safe to
-- cast the Linearity kind.
castLinearity :: Color (CIERGB l') e -> Color (CIERGB l) e
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.CIE1931.RGB.CIERGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.CIE1931.RGB.CIERGB l) e
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.CIE1931.RGB.CIERGB l) 'Graphics.Color.Illuminant.CIE1931.E e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.CIE1931.RGB.CIERGB 'Graphics.Color.Illuminant.CIE1931.E
module Graphics.Color.Space.RGB.Derived.CIERGB
-- | The original CIE1931 RGB color space with an arbitrary
-- illuminant
data CIERGB (i :: k) (l :: Linearity)
-- | CIE RGB does not utilize any gamma function, therefore it is safe to
-- cast the Linearity kind.
castLinearity :: Color (CIERGB i l') e -> Color (CIERGB i l) e
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) e)
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) e)
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l))
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) e
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity) e. (Graphics.Color.Space.Internal.Illuminant i, Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i l) i e
instance forall k (i :: k). Graphics.Color.Space.Internal.Illuminant i => Graphics.Color.Space.RGB.Internal.RedGreenBlue (Graphics.Color.Space.RGB.Derived.CIERGB.CIERGB i) i
module Graphics.Color.Space.RGB.CIERGB
module Graphics.Color.Adaptation.VonKries
-- | This function allows conversion of a color between any two color
-- spaces. It uses a very common VonKries chromatic adaptation
-- transform with Bradford matrix. One of more general functions
-- convertWith or convertElevatedWith can be used for
-- selecting another chromatic adaptation algorithm.
convert :: (ColorSpace cs' i' e', ColorSpace cs i e) => Color cs' e' -> Color cs e
data VonKries
-- | VonKries chromatic adaptation transform
--
-- -- >>> cat :: CAT 'VonKries Float -- CAT VonKries 'VonKries Float -- [ [ 0.40024000, 0.70760000,-0.08081000 ] -- , [-0.22630000, 1.16532000, 0.04570000 ] -- , [ 0.00000000, 0.00000000, 0.91822000 ] ] -- -- >>> icat :: ICAT 'VonKries Float -- ICAT VonKries 'VonKries Float -- [ [ 1.85993650,-1.12938170, 0.21989742 ] -- , [ 0.36119142, 0.63881250,-0.00000637 ] -- , [-0.00000000,-0.00000000, 1.08906360 ] ] --VonKries :: VonKries -- | Bradford chromatic adaptation transform -- --
-- >>> cat :: CAT 'Bradford Float -- CAT VonKries 'Bradford Float -- [ [ 0.89510000, 0.26640000,-0.16140000 ] -- , [-0.75020000, 1.71350000, 0.03670000 ] -- , [ 0.03890000,-0.06850000, 1.02960000 ] ] -- -- >>> icat :: ICAT 'Bradford Float -- ICAT VonKries 'Bradford Float -- [ [ 0.98699290,-0.14705427, 0.15996265 ] -- , [ 0.43230528, 0.51836026, 0.04929122 ] -- , [-0.00852867, 0.04004282, 0.96848667 ] ] --Bradford :: VonKries -- | Fairchild chromatic adaptation transform -- --
-- >>> cat :: CAT 'Fairchild Float -- CAT VonKries 'Fairchild Float -- [ [ 0.85620000, 0.33720000,-0.19340000 ] -- , [-0.83600000, 1.83270000, 0.00330000 ] -- , [ 0.03570000,-0.04690000, 1.01120000 ] ] -- -- >>> icat :: ICAT 'Fairchild Float -- ICAT VonKries 'Fairchild Float -- [ [ 0.98739994,-0.17682500, 0.18942511 ] -- , [ 0.45043513, 0.46493286, 0.08463200 ] -- , [-0.01396833, 0.02780657, 0.98616177 ] ] --Fairchild :: VonKries -- | CIECAT02 chromatic adaptation transform -- --
-- >>> cat :: CAT 'CIECAT02 Float -- CAT VonKries 'CIECAT02 Float -- [ [ 0.73280000, 0.42960000,-0.16240000 ] -- , [-0.70360000, 1.69750000, 0.00610000 ] -- , [ 0.00300000, 0.01360000, 0.98340000 ] ] -- -- >>> icat :: ICAT 'CIECAT02 Float -- ICAT VonKries 'CIECAT02 Float -- [ [ 1.09612380,-0.27886900, 0.18274519 ] -- , [ 0.45436904, 0.47353318, 0.07209781 ] -- , [-0.00962761,-0.00569803, 1.01532570 ] ] --CIECAT02 :: VonKries -- | CMCCAT2000 chromatic adaptation transform -- --
-- >>> cat :: CAT 'CMCCAT2000 Float -- CAT VonKries 'CMCCAT2000 Float -- [ [ 0.79820000, 0.33890000,-0.13710000 ] -- , [-0.59180000, 1.55120000, 0.04060000 ] -- , [ 0.00080000, 0.02390000, 0.97530000 ] ] -- -- >>> icat :: ICAT 'CMCCAT2000 Float -- ICAT VonKries 'CMCCAT2000 Float -- [ [ 1.07645010,-0.23766239, 0.16121234 ] -- , [ 0.41096430, 0.55434180, 0.03469386 ] -- , [-0.01095376,-0.01338936, 1.02434310 ] ] --CMCCAT2000 :: VonKries -- | Chromatic adaptation transformation matrix newtype CAT (t :: k) e CAT :: M3x3 e -> CAT (t :: k) e -- | Inverse of chromatic adaptation transformation matrix newtype ICAT (t :: k) e ICAT :: M3x3 e -> ICAT (t :: k) e class ChromaticAdaptationTransform (t :: VonKries) cat :: (ChromaticAdaptationTransform t, RealFloat e) => CAT t e icat :: forall t e. (ChromaticAdaptationTransform t, RealFloat e) => ICAT t e -- | VonKries chromatic adaptation transform. vonKriesAdaptation :: ChromaticAdaptation 'VonKries it ir e => Adaptation 'VonKries it ir e -- | Bradford chromatic adaptation transform, as defined in the -- CIECAM97s color appearance model. bradfordAdaptation :: ChromaticAdaptation 'Bradford it ir e => Adaptation 'Bradford it ir e -- | Fairchild chromatic adaptation transform. fairchildAdaptation :: ChromaticAdaptation 'Fairchild it ir e => Adaptation 'Fairchild it ir e -- | CIECAT02 chromatic adaptation as defined it CIECAM02 -- color appearance model ciecat02Adaptation :: ChromaticAdaptation 'CIECAT02 it ir e => Adaptation 'CIECAT02 it ir e -- | CMCCAT2000 chromatic adaptation. Predecessor of -- CIECAT02. as defined it CIECAM02 color appearance model cmccat2000Adaptation :: ChromaticAdaptation 'CMCCAT2000 it ir e => Adaptation 'CIECAT02 it ir e adaptationMatrix :: forall t it ir e. (ChromaticAdaptationTransform t, ChromaticAdaptation t it ir e) => Adaptation (t :: VonKries) it ir e instance forall (t :: Graphics.Color.Adaptation.VonKries.VonKries) kt (it :: kt) kr (ir :: kr) e. GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Adaptation.Internal.Adaptation t it ir e) instance forall k (t :: k) e. GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Adaptation.VonKries.CAT t e) instance forall k (t :: k) e. GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Adaptation.VonKries.ICAT t e) instance forall k (i :: k). GHC.Show.Show (Graphics.Color.Adaptation.VonKries.I i) instance forall kt (it :: kt) kr (ir :: kr) e (t :: Graphics.Color.Adaptation.VonKries.VonKries). (Graphics.Color.Space.Internal.Illuminant it, Graphics.Color.Space.Internal.Illuminant ir, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Adaptation.Internal.Adaptation t it ir e) instance Graphics.Color.Adaptation.VonKries.ChromaticAdaptationTransform 'Graphics.Color.Adaptation.VonKries.VonKries instance Graphics.Color.Adaptation.VonKries.ChromaticAdaptationTransform 'Graphics.Color.Adaptation.VonKries.Bradford instance Graphics.Color.Adaptation.VonKries.ChromaticAdaptationTransform 'Graphics.Color.Adaptation.VonKries.Fairchild instance Graphics.Color.Adaptation.VonKries.ChromaticAdaptationTransform 'Graphics.Color.Adaptation.VonKries.CIECAT02 instance Graphics.Color.Adaptation.VonKries.ChromaticAdaptationTransform 'Graphics.Color.Adaptation.VonKries.CMCCAT2000 instance forall k (t :: k) e. (Data.Typeable.Internal.Typeable t, Data.Typeable.Internal.Typeable k, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Adaptation.VonKries.ICAT t e) instance forall k (t :: k) e. (Data.Typeable.Internal.Typeable t, Data.Typeable.Internal.Typeable k, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Adaptation.VonKries.CAT t e) instance forall kt (it :: kt) kr (ir :: kr) e (t :: Graphics.Color.Adaptation.VonKries.VonKries). (Graphics.Color.Space.Internal.Illuminant it, Graphics.Color.Space.Internal.Illuminant ir, Graphics.Color.Algebra.Elevator.Elevator e, GHC.Float.RealFloat e) => Graphics.Color.Adaptation.Internal.ChromaticAdaptation t it ir e module Graphics.Color.Adaptation class (Illuminant it, Illuminant ir, Elevator e, RealFloat e) => ChromaticAdaptation (t :: k) (it :: kt) (ir :: kr) e where { data family Adaptation t it ir e :: Type; } adaptColorXYZ :: ChromaticAdaptation t it ir e => Adaptation t it ir e -> Color (XYZ it) e -> Color (XYZ ir) e chromaticAdaptation :: ChromaticAdaptation t it ir e => Adaptation t it ir e -> Gamut cs it e -> Gamut cs ir e convertWith :: (ChromaticAdaptation t i' i e, ColorSpace cs' i' e, ColorSpace cs i e) => Adaptation t i' i e -> Color cs' e -> Color cs e convertElevatedWith :: (ChromaticAdaptation t i' i a, ColorSpace cs' i' e', ColorSpace cs i e) => Adaptation t i' i a -> Color cs' e' -> Color cs e -- | Convert a color from one color space into another one with the same -- illuminant, thus not requiring a chromatic adaptation. convertNoAdaptation :: forall cs' e' cs e i. (ColorSpace cs' i e', ColorSpace cs i e) => Color cs' e' -> Color cs e module Graphics.Color.Space.RGB.Luma -- | Constructor for Luma Y`. (Not to be confused with luminance -- Y) pattern Y' :: e -> Color (Y' cs) e -- | Constructor for Y` with alpha channel. (Not to be confused with -- luminance Y) pattern Y'A :: e -> e -> Color (Alpha (Y' cs)) e pattern Luma :: () => Color X e -> Color (Y' cs) e -- | Luma of a non-linear gamma corrected RGB color space. (Not to -- be confused with luminance Y) data Y' (cs :: Linearity -> Type) class Luma (cs :: Linearity -> Type) rWeight :: (Luma cs, RealFloat e) => Weight cs e gWeight :: (Luma cs, RealFloat e) => Weight cs e bWeight :: (Luma cs, RealFloat e) => Weight cs e newtype Weight cs e Weight :: e -> Weight cs e [unWeight] :: Weight cs e -> e -- | Weights imposed on individual channels of a 3-component color newtype Weights e Weights :: V3 e -> Weights e [unWeights] :: Weights e -> V3 e -- | Convert a non-linear RGB pixel to a luma pixel rgbLuma :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Color (cs 'NonLinear) e' -> Color (Y' cs) e -- | Get the weights of a non-linear RGB color space that can be used for -- converting to Luma rgbLumaWeights :: forall cs e' e. (Luma cs, RealFloat e) => Color (cs 'NonLinear) e' -> Weights e -- | Convert Luma directly into the linear version of base space. This is -- equivalent to `dcctf . toBaseSpace`, but is a bit faster, since -- inverse transfer function is applied only once toBaseLinearSpace :: forall cs e i. (RedGreenBlue cs i, Applicative (Color (cs 'Linear)), RealFloat e) => Color (Y' cs) e -> Color (cs 'Linear) e instance forall k (cs :: k). GHC.Base.Functor (Graphics.Color.Space.RGB.Luma.Weight cs) instance forall k (cs :: k) e. GHC.Float.Floating e => GHC.Float.Floating (Graphics.Color.Space.RGB.Luma.Weight cs e) instance forall k (cs :: k) e. GHC.Real.Fractional e => GHC.Real.Fractional (Graphics.Color.Space.RGB.Luma.Weight cs e) instance forall k (cs :: k) e. GHC.Num.Num e => GHC.Num.Num (Graphics.Color.Space.RGB.Luma.Weight cs e) instance forall k (cs :: k) e. GHC.Show.Show e => GHC.Show.Show (Graphics.Color.Space.RGB.Luma.Weight cs e) instance forall k (cs :: k) e. GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Space.RGB.Luma.Weight cs e) instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs) e) instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs) e) instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs)) instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs)) instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs)) instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs)) instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs) e) instance forall k (cs :: Graphics.Color.Space.RGB.Internal.Linearity -> *) (i :: k) e. (Data.Typeable.Internal.Typeable cs, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Space.Internal.ColorSpace (cs 'Graphics.Color.Space.RGB.Internal.Linear) i e, Graphics.Color.Space.Internal.ColorSpace (cs 'Graphics.Color.Space.RGB.Internal.NonLinear) i e, Graphics.Color.Space.RGB.Luma.Luma cs, Graphics.Color.Space.RGB.Internal.RedGreenBlue cs i, GHC.Float.RealFloat e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Luma.Y' cs) i e instance (Data.Typeable.Internal.Typeable cs, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Luma.Y' cs) e) instance (Data.Typeable.Internal.Typeable cs, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Luma.Y' cs) e module Graphics.Color.Space.RGB.ITU.Rec601 pattern BT601_525 :: () => Color RGB e -> Color (BT601_525 l) e -- | ITU-R BT.601 (525) color space data BT601_525 (l :: Linearity) pattern BT601_625 :: () => Color RGB e -> Color (BT601_625 l) e -- | ITU-R BT.601 (625) color space data BT601_625 (l :: Linearity) -- | Whitepoint D65 that is so commonly used for sRGB and other color -- spaces defined by ITU: Rec.601 (525 and 625) and Rec.709 standards. It -- is slightly different than D65 that is defined by CIE1931 and -- D65 specified in Rec.470. -- --
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) e)
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 Graphics.Color.Illuminant.ITU.Rec601.D65
instance Graphics.Color.Space.RGB.Luma.Luma Graphics.Color.Space.RGB.ITU.Rec601.BT601_625
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 Graphics.Color.Illuminant.ITU.Rec601.D65
instance Graphics.Color.Space.RGB.Luma.Luma Graphics.Color.Space.RGB.ITU.Rec601.BT601_525
module Graphics.Color.Space.RGB.ITU.Rec709
pattern BT709 :: () => Color RGB e -> Color (BT709 l) e
-- | ITU-R BT.709 color space
data BT709 (l :: Linearity)
-- | Whitepoint D65 that is so commonly used for sRGB and other color
-- spaces defined by ITU: Rec.601 (525 and 625) and Rec.709 standards. It
-- is slightly different than D65 that is defined by CIE1931 and
-- D65 specified in Rec.470.
--
--
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec709.BT709 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec709.BT709 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.ITU.Rec709.BT709 Graphics.Color.Illuminant.ITU.Rec601.D65
instance Graphics.Color.Space.RGB.Luma.Luma Graphics.Color.Space.RGB.ITU.Rec709.BT709
module Graphics.Color.Space.RGB.AdobeRGB
pattern AdobeRGB :: () => Color RGB e -> Color (AdobeRGB l) e
-- | Constructor for a color in AdobeRGB color space
pattern ColorAdobeRGB :: e -> e -> e -> Color (AdobeRGB l) e
-- | Constructor for a color in AdobeRGB color space with alpha
-- channel
pattern ColorAdobeRGBA :: e -> e -> e -> e -> Color (Alpha (AdobeRGB l)) e
-- | A very common AdobeRGB (1998) color space with:
--
-- -- >>> :set -XDataKinds -- -- >>> import Graphics.Color.Space.RGB.AdobeRGB -- -- >>> npm :: NPM AdobeRGB Float -- [ [ 0.57667000, 0.18556000, 0.18823000 ] -- , [ 0.29734000, 0.62736000, 0.07529000 ] -- , [ 0.02703000, 0.07069000, 0.99134000 ] ] ---- --
-- >>> :set -XDataKinds -- -- >>> import Graphics.Color.Space.RGB.AdobeRGB -- -- >>> inpm :: INPM AdobeRGB Float -- [ [ 2.04159000,-0.56501000,-0.34473000 ] -- , [-0.96924000, 1.87597000, 0.04156000 ] -- , [ 0.01344000,-0.11836000, 1.01517000 ] ] --data AdobeRGB (l :: Linearity) -- | Whitepoint D65 that is so commonly used for sRGB and other color -- spaces defined by ITU: Rec.601 (525 and 625) and Rec.709 standards. It -- is slightly different than D65 that is defined by CIE1931 and -- D65 specified in Rec.470. -- --
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB Graphics.Color.Illuminant.ITU.Rec601.D65
module Graphics.Color.Space.RGB.Derived.AdobeRGB
-- | The most common AdobeRGB color space with an arbitrary
-- illuminant
data AdobeRGB (i :: k) (l :: Linearity)
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l) e)
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l) e)
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l))
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i l) e
instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i 'Graphics.Color.Space.RGB.Internal.Linear) i e
instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i 'Graphics.Color.Space.RGB.Internal.NonLinear) i e
instance forall k (i :: k). Graphics.Color.Space.Internal.Illuminant i => Graphics.Color.Space.RGB.Internal.RedGreenBlue (Graphics.Color.Space.RGB.Derived.AdobeRGB.AdobeRGB i) i
module Graphics.Color.Space.RGB.SRGB
pattern SRGB :: () => Color RGB e -> Color (SRGB l) e
-- | Constructor for a color in sRGB color space
pattern ColorSRGB :: e -> e -> e -> Color (SRGB l) e
-- | Constructor for a color in sRGB color space with alphs
-- channel
pattern ColorSRGBA :: e -> e -> e -> e -> Color (Alpha (SRGB l)) e
-- | The most common sRGB color space, which is defined with:
--
-- -- >>> :set -XDataKinds -- -- >>> import Graphics.Color.Space.RGB -- -- >>> npm :: NPM SRGB Float -- [ [ 0.41240000, 0.35760000, 0.18050000 ] -- , [ 0.21260000, 0.71520000, 0.07220000 ] -- , [ 0.01930000, 0.11920000, 0.95050000 ] ] ---- --
-- >>> :set -XDataKinds -- -- >>> import Graphics.Color.Space.RGB -- -- >>> inpm :: INPM SRGB Float -- [ [ 3.24060000,-1.53720000,-0.49860000 ] -- , [-0.96890000, 1.87580000, 0.04150000 ] -- , [ 0.05570000,-0.20400000, 1.05700000 ] ] --data SRGB (l :: Linearity) -- | This is an approximation of CIE1931 D50 white point defined in -- ICC PCS. Useful for chromatic adaptation. -- --
-- >>> whitePoint :: WhitePoint D50 Double
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D50:( 0.3457029149190000, 0.3585385966800000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D50) Float
-- <XYZ * D50:( 0.96420000, 1.00000000, 0.82490010)>
--
-- >>> colorTemperature :: CCT D50
-- CCT {unCCT = 5003.0}
--
data D50
-- | Whitepoint D65 that is so commonly used for sRGB and other color
-- spaces defined by ITU: Rec.601 (525 and 625) and Rec.709 standards. It
-- is slightly different than D65 that is defined by CIE1931 and
-- D65 specified in Rec.470.
--
--
-- >>> whitePoint :: WhitePoint D65 Float
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D65) Float
-- <XYZ * D65:( 0.95045596, 1.00000000, 1.08905770)>
--
-- >>> colorTemperature :: CCT D65
-- CCT {unCCT = 6504.0}
--
data D65
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.SRGB.SRGB l) e)
instance (Data.Typeable.Internal.Typeable l, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.SRGB.SRGB l) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.SRGB.SRGB 'Graphics.Color.Space.RGB.Internal.Linear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.SRGB.SRGB 'Graphics.Color.Space.RGB.Internal.NonLinear) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.RGB.Internal.RedGreenBlue Graphics.Color.Space.RGB.SRGB.SRGB Graphics.Color.Illuminant.ITU.Rec601.D65
instance Graphics.Color.Space.RGB.Luma.Luma Graphics.Color.Space.RGB.SRGB.SRGB
module Graphics.Color.Space.RGB.Derived.SRGB
-- | The most common sRGB color space with an arbitrary illuminant
data SRGB (i :: k) (l :: Linearity)
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l) e)
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l) e)
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l))
instance forall k (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l))
instance forall k e (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l) e)
instance forall (l :: Graphics.Color.Space.RGB.Internal.Linearity) k (i :: k) e. (Data.Typeable.Internal.Typeable l, Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i l) e
instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i 'Graphics.Color.Space.RGB.Internal.Linear) i e
instance forall k (i :: k) e. (Graphics.Color.Space.Internal.Illuminant i, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i 'Graphics.Color.Space.RGB.Internal.NonLinear) i e
instance forall k (i :: k). Graphics.Color.Space.Internal.Illuminant i => Graphics.Color.Space.RGB.Internal.RedGreenBlue (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i) i
instance forall k (i :: k). Graphics.Color.Space.RGB.Luma.Luma (Graphics.Color.Space.RGB.Derived.SRGB.SRGB i)
module Graphics.Color.Space.RGB.Alternative.YCbCr
-- | Constructor for an RGB color space in an alternative Y'CbCr color
-- model
pattern ColorY'CbCr :: e -> e -> e -> Color (Y'CbCr cs) e
-- | Constructor for Y'CbCr with alpha channel.
pattern ColorY'CbCrA :: e -> e -> e -> e -> Color (Alpha (Y'CbCr cs)) e
-- | Y'CbCr representation for some non-linear
-- (RedGreenBlue cs i) color space
data Y'CbCr (cs :: Linearity -> Type)
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
-- | This conversion is only correct for sRGB and Rec601. Source: ITU-T
-- Rec. T.871
ycbcr2srgb :: (RedGreenBlue cs i, RealFloat e) => Color (Y'CbCr cs) e -> Color (cs 'NonLinear) e
-- | This conversion is only correct for sRGB and Rec601. Source: ITU-T
-- Rec. T.871
srgb2ycbcr :: (RedGreenBlue cs i, RealFloat e) => Color (cs 'NonLinear) e -> Color (Y'CbCr cs) e
-- | Convert any RGB color space that has Luma specified to
-- Y'CbCr
toColorY'CbCr :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Color (cs 'NonLinear) e' -> Color (Y'CbCr cs) e
-- | Convert Y'CbCr to the base RGB color space, which must have
-- Luma implemented.
fromColorY'CbCr :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Color (Y'CbCr cs) e' -> Color (cs 'NonLinear) e
instance GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs) e)
instance GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs) e)
instance GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs))
instance GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs))
instance Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs))
instance Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs))
instance Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs) e)
instance (Data.Typeable.Internal.Typeable cs, Graphics.Color.Model.Internal.ColorModel (cs 'Graphics.Color.Space.RGB.Internal.NonLinear) e, Graphics.Color.Algebra.Elevator.Elevator e) => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs) e)
instance (Data.Typeable.Internal.Typeable cs, Graphics.Color.Model.Internal.ColorModel (cs 'Graphics.Color.Space.RGB.Internal.NonLinear) e, Graphics.Color.Algebra.Elevator.Elevator e) => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr cs) e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr Graphics.Color.Space.RGB.SRGB.SRGB) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr Graphics.Color.Space.RGB.ITU.Rec601.BT601_525) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr Graphics.Color.Space.RGB.ITU.Rec601.BT601_625) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Algebra.Elevator.Elevator e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr Graphics.Color.Space.RGB.ITU.Rec709.BT709) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance forall k (cs :: k -> Graphics.Color.Space.RGB.Internal.Linearity -> *) (i :: k) e. (Data.Typeable.Internal.Typeable cs, Graphics.Color.Space.RGB.Luma.Luma (cs i), Graphics.Color.Space.Internal.ColorSpace (cs i 'Graphics.Color.Space.RGB.Internal.NonLinear) i e, Graphics.Color.Space.RGB.Internal.RedGreenBlue (cs i) i) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.YCbCr.Y'CbCr (cs i)) i e
module Graphics.Color.Space.RGB.Alternative.CMYK
-- | Constructor for an RGB color space in an alternative CMYK color model
pattern ColorCMYK :: e -> e -> e -> e -> Color (CMYK cs) e
-- | Constructor for CMYK with alpha channel.
pattern ColorCMYKA :: e -> e -> e -> e -> e -> Color (Alpha (CMYK cs)) e
-- | CMYK representation for some (RedGreenBlue cs
-- i) color space
data CMYK cs
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
instance forall k e (cs :: k). GHC.Classes.Eq e => GHC.Classes.Eq (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs) e)
instance forall k e (cs :: k). GHC.Classes.Ord e => GHC.Classes.Ord (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs) e)
instance forall k (cs :: k). GHC.Base.Functor (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs))
instance forall k (cs :: k). GHC.Base.Applicative (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs))
instance forall k (cs :: k). Data.Foldable.Foldable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs))
instance forall k (cs :: k). Data.Traversable.Traversable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs))
instance forall k e (cs :: k). Foreign.Storable.Storable e => Foreign.Storable.Storable (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => GHC.Show.Show (Graphics.Color.Model.Internal.Color (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs) e)
instance Graphics.Color.Model.Internal.ColorModel cs e => Graphics.Color.Model.Internal.ColorModel (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK cs) e
instance forall k (cs :: k -> Graphics.Color.Space.RGB.Internal.Linearity -> *) (i :: k) (l :: Graphics.Color.Space.RGB.Internal.Linearity) e. (Data.Typeable.Internal.Typeable cs, Graphics.Color.Space.Internal.ColorSpace (cs i l) i e, Graphics.Color.Space.RGB.Internal.RedGreenBlue (cs i) i) => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (cs i l)) i e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.SRGB.SRGB l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.SRGB.SRGB l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.AdobeRGB.AdobeRGB l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.ITU.Rec470.BT470_525 l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.ITU.Rec470.BT470_625 l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.ITU.Rec601.BT601_525 l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.ITU.Rec601.BT601_625 l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
instance Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l) Graphics.Color.Illuminant.ITU.Rec601.D65 e => Graphics.Color.Space.Internal.ColorSpace (Graphics.Color.Space.RGB.Alternative.CMYK.CMYK (Graphics.Color.Space.RGB.ITU.Rec709.BT709 l)) Graphics.Color.Illuminant.ITU.Rec601.D65 e
module Graphics.Color.Space.RGB.Alternative
-- | Constructor for an RGB color space.
pattern ColorRGB :: RedGreenBlue cs i => e -> e -> e -> Color (cs l) e
-- | Constructor for an RGB color space with Alpha channel
pattern ColorRGBA :: RedGreenBlue cs i => e -> e -> e -> e -> Color (Alpha (cs l)) e
class Illuminant i => RedGreenBlue (cs :: Linearity -> Type) (i :: k) | cs -> i
-- | RGB primaries that are defined for the RGB color space, while point is
-- defined by the i type parameter
gamut :: (RedGreenBlue cs i, RealFloat e) => Gamut cs i e
transfer :: (RedGreenBlue cs i, RealFloat e) => e -> e
itransfer :: (RedGreenBlue cs i, RealFloat e) => e -> e
-- | Normalized primary matrix for this RGB color space. Default
-- implementation derives it from chromaticity
npm :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => NPM cs e
-- | Inverse normalized primary matrix for this RGB color space. Default
-- implementation derives it from chromaticity
inpm :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => INPM cs e
-- | Lift RGB color model into a RGB color space
mkColorRGB :: RedGreenBlue cs i => Color RGB e -> Color (cs l) e
-- | Lift RGB color model into a RGB color space
mkColorRGB :: (RedGreenBlue cs i, Coercible (Color RGB e) (Color (cs l) e)) => Color RGB e -> Color (cs l) e
-- | Drop RGB color space down to the RGB color model
unColorRGB :: RedGreenBlue cs i => Color (cs l) e -> Color RGB e
-- | Drop RGB color space down to the RGB color model
unColorRGB :: (RedGreenBlue cs i, Coercible (Color (cs l) e) (Color RGB e)) => Color (cs l) e -> Color RGB e
data Linearity
Linear :: Linearity
NonLinear :: Linearity
-- | Encoding color component transfer function (forward). Also known as
-- opto-electronic transfer function (OETF / OECF).
ecctf :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Color (cs 'Linear) e -> Color (cs 'NonLinear) e
-- | Decoding color component transfer function (inverse). Also known as
-- electro-optical transfer function (EOTF / EOCF).
dcctf :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Color (cs 'NonLinear) e -> Color (cs 'Linear) e
-- | RGB color space gamut specification.
data Gamut (cs :: Linearity -> Type) i e
Gamut :: !Primary i e -> !Primary i e -> !Primary i e -> Gamut (cs :: Linearity -> Type) i e
[gamutRedPrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
[gamutGreenPrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
[gamutBluePrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
-- | This function allows for creating a completely mismatched color space
-- spec. Make sure you know what you are doing, if you need to use it.
coerceGamut :: Gamut cs' i' e -> Gamut cs i e
rgb2xyz :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'NonLinear) e -> Color (XYZ i) e
rgbLinear2xyz :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'Linear) e -> Color (XYZ i) e
xyz2rgb :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (XYZ i) e -> Color (cs 'NonLinear) e
xyz2rgbLinear :: forall cs i e. (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (XYZ i) e -> Color (cs 'Linear) e
rgbLuminance :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'NonLinear) e -> Color (Y i) e
-- | Linear transformation of a color into a linear luminance, i.e. the Y
-- component of XYZ color space
rgbLinearLuminance :: forall cs i e. (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'Linear) e -> Color (Y i) e
-- | Normalized primary matrix (NPM), which is used to tranform linear RGB
-- color space into XYZ color space.
newtype NPM cs e
NPM :: M3x3 e -> NPM cs e
[unNPM] :: NPM cs e -> M3x3 e
-- | Linear transformation of a pixel in a linear RGB color space into XYZ
-- color space
--
--
-- >>> :set -XDataKinds
--
-- >>> import Debug.Trace
--
-- >>> import Graphics.Color.Illuminant.CIE1931
--
-- >>> import Graphics.Color.Space.RGB.Derived.SRGB
--
-- >>> :{
-- srgbFromLinear :: Color (SRGB 'D65 'Linear) Float -> Color (XYZ 'D65) Float
-- srgbFromLinear = npmApply npm'
-- where npm' = trace "Evaluated only once!!!" npm :: NPM (SRGB 'D65) Float
-- :}
--
--
-- -- >>> srgbFromLinear $ ColorRGB 0.1 0.2 0.3 -- <XYZ CIE1931 'D65:(Evaluated only once!!! -- 0.16688849, 0.18595251, 0.31085595)> -- -- >>> srgbFromLinear $ ColorRGB 0.1 0.2 0.3 -- <XYZ CIE1931 'D65:( 0.16688849, 0.18595251, 0.31085595)> -- -- >>> rgb = ColorRGB 0.1 0.2 0.3 :: Color (SRGB 'D65 'Linear) Float -- -- >>> npmApply npm rgb :: Color (XYZ 'D65) Float -- <XYZ CIE1931 'D65:( 0.16688849, 0.18595251, 0.31085595)> ---- -- Here is a comparison with a non-liner sRGB conversion: -- --
-- >>> rgb = ColorRGB 0.1 0.2 0.3 :: Color (SRGB 'D65 'NonLinear) Float
--
-- >>> npmApply npm (dcctf rgb) :: Color (XYZ 'D65) Float {- non-linear transformation -}
-- <XYZ CIE1931 'D65:( 0.02918611, 0.03109305, 0.07373714)>
--
-- >>> toColorXYZ rgb :: Color (XYZ 'D65) Float {- non-linear transformation -}
-- <XYZ CIE1931 'D65:( 0.02918611, 0.03109305, 0.07373714)>
--
npmApply :: (RedGreenBlue cs i, Elevator e) => NPM cs e -> Color (cs 'Linear) e -> Color (XYZ i) e
-- | Derive a NPM form chromaticities and a white point
npmDerive :: forall cs i e. (ColorSpace (cs 'Linear) i e, RealFloat e) => Gamut cs i e -> NPM cs e
-- | Inverse normalized primary matrix (iNPM), which is used to tranform
-- linear XYZ color space into a linear RGB color space. It is
-- literally a inverse matrix of NPM
newtype INPM cs e
INPM :: M3x3 e -> INPM cs e
[unINPM] :: INPM cs e -> M3x3 e
-- | Linear transformation of a pixel in XYZ color space into a linear RGB
-- color space
inpmApply :: (RedGreenBlue cs i, Elevator e) => INPM cs e -> Color (XYZ i) e -> Color (cs 'Linear) e
-- | Derive an INPM form chromaticities and a white point
inpmDerive :: forall cs i e. (ColorSpace (cs 'Linear) i e, RealFloat e) => Gamut cs i e -> INPM cs e
-- | Get the Chromaticity of a pixel in RGB color space. Color
-- itself isn't actually evaluated, its type carries enough information
-- for this operation.
rgbColorGamut :: (RedGreenBlue cs i, RealFloat e) => Color (cs l) a -> Gamut cs i e
-- | Get the white point of any RGB pixel. Color itself isn't evaluated,
-- since its type carries enough information for getting the white point.
--
--
-- >>> import Graphics.Color.Space.RGB
--
-- >>> :set -XTypeApplications
--
-- >>> pixelWhitePoint @Float (ColorSRGB @Word8 1 2 3)
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
pixelWhitePoint :: forall e cs a i l. (RedGreenBlue cs i, RealFloat e) => Color (cs l) a -> WhitePoint i e
-- | Get the WhitePoint of chromaticity. Chromaticity itself
-- isn't actually evaluated, its type carries enough information for this
-- operation.
gamutWhitePoint :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Gamut cs i e -> WhitePoint i e
class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where {
type family Components cs e :: Type;
}
-- | Convert a Color to a representation suitable for storage as an unboxed
-- element, usually a tuple of channels.
toComponents :: ColorModel cs e => Color cs e -> Components cs e
-- | Convert from an elemnt representation back to a Color.
fromComponents :: ColorModel cs e => Components cs e -> Color cs e
-- | Display the cs portion of the pixel. Color itself will not be
-- evaluated.
showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS
data Alpha cs
type family Opaque cs
-- | Add an alpha channel value to an opaque pixel
addAlpha :: Color cs e -> e -> Color (Alpha cs) e
-- | Get the alpha channel value for the pixel
getAlpha :: Color (Alpha cs) e -> e
-- | Change the alpha channel value for the pixel
setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e
-- | Get the opaque pixel value, while leaving alpha channel intact.
dropAlpha :: Color (Alpha cs) e -> Color cs e
-- | Change the alpha channel value for the pixel
modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e
-- | Change the opaque pixel value, while leaving alpha channel intact.
modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
class (Illuminant i, ColorModel (BaseModel cs) e, ColorModel cs e) => ColorSpace cs (i :: k) e | cs -> i where {
type family BaseModel cs :: Type;
type family BaseSpace cs :: Type;
type BaseSpace cs = cs;
}
-- | Drop color space down to the base color model
toBaseModel :: ColorSpace cs i e => Color cs e -> Color (BaseModel cs) e
-- | Drop color space down to the base color model
toBaseModel :: (ColorSpace cs i e, Coercible (Color cs e) (Color (BaseModel cs) e)) => Color cs e -> Color (BaseModel cs) e
-- | Promote color model to a color space
fromBaseModel :: ColorSpace cs i e => Color (BaseModel cs) e -> Color cs e
-- | Promote color model to a color space
fromBaseModel :: (ColorSpace cs i e, Coercible (Color (BaseModel cs) e) (Color cs e)) => Color (BaseModel cs) e -> Color cs e
toBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color cs e -> Color (BaseSpace cs) e
fromBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color (BaseSpace cs) e -> Color cs e
-- | Get the relative luminance of a color
luminance :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (Y i) a
toColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
toColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
fromColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
fromColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
-- | This is a data type that encodes a data point on the chromaticity
-- diagram
newtype Chromaticity i e
Chromaticity :: Color (CIExyY i) e -> Chromaticity i e
[chromaticityCIExyY] :: Chromaticity i e -> Color (CIExyY i) e
newtype Primary (i :: k) e
PrimaryChromaticity :: Chromaticity i e -> Primary (i :: k) e
[primaryChromaticity] :: Primary (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern Primary :: e -> e -> Primary i e
xPrimary :: Primary i e -> e
yPrimary :: Primary i e -> e
-- | Compute z = 1 - x - y of a Primary.
zPrimary :: Num e => Primary i e -> e
-- | Compute XYZ tristimulus of a Primary.
primaryXZ :: Fractional e => e -> Primary i e -> Color (XYZ i) e
-- | Compute normalized XYZ tristimulus of a Primary, where
-- Y = 1
primaryTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Primary i e -> Color (XYZ i) e
class (Typeable i, Typeable k, KnownNat (Temperature i)) => Illuminant (i :: k) where {
type family Temperature i :: n;
}
whitePoint :: (Illuminant i, RealFloat e) => WhitePoint i e
colorTemperature :: Illuminant i => CCT i
newtype WhitePoint (i :: k) e
WhitePointChromaticity :: Chromaticity i e -> WhitePoint (i :: k) e
[whitePointChromaticity] :: WhitePoint (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern WhitePoint :: e -> e -> WhitePoint i e
-- | x value of a WhitePoint
xWhitePoint :: WhitePoint i e -> e
-- | y value of a WhitePoint
yWhitePoint :: WhitePoint i e -> e
-- | Compute z value of a WhitePoint: z = 1 - x -
-- y
zWhitePoint :: Num e => WhitePoint i e -> e
-- | Compute XYZ tristimulus of a white point.
whitePointXZ :: Fractional e => e -> WhitePoint i e -> Color (XYZ i) e
-- | Compute a normalized XYZ tristimulus of a white point, where
-- Y = 1
whitePointTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Color (XYZ i) e
-- | Correlated color temperature (CCT) of a white point in Kelvin
newtype CCT (i :: k)
CCT :: Double -> CCT (i :: k)
[unCCT] :: CCT (i :: k) -> Double
-- | Relative Luminance of a color
data Y (i :: k)
-- | Constructor for Y with alpha channel.
pattern Y :: e -> Color (Y i) e
-- | Constructor for Y with alpha channel.
pattern YA :: e -> e -> Color (Alpha (Y i)) e
-- | The original color space CIE 1931 XYZ color space
data XYZ i
-- | Constructor for the most common XYZ color space
pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e
-- | Constructor for XYZ with alpha channel.
pattern ColorXYZA :: e -> e -> e -> e -> Color (Alpha (XYZ i)) e
-- | Alternative representation of the CIE 1931 XYZ color space
data CIExyY (i :: k)
-- | Constructor CIE xyY color space. It only requires x
-- and y, then Y part will always be equal to 1.
pattern ColorCIExy :: e -> e -> Color (CIExyY i) e
-- | Patttern match on the CIE xyY, 3rd argument Y is
-- always set to 1
pattern ColorCIExyY :: Num e => e -> e -> e -> Color (CIExyY i) e
showsColorModel :: ColorModel cs e => Color cs e -> ShowS
-- | A class with a set of functions that allow for changing precision by
-- shrinking and streatching the values.
class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e
maxValue :: Elevator e => e
minValue :: Elevator e => e
fieldFormat :: Elevator e => e -> FieldFormat
-- | This is a pretty printer for the value.
toShowS :: Elevator e => e -> ShowS
-- | This is a pretty printer for the value.
toShowS :: (Elevator e, PrintfArg e) => e -> ShowS
-- | Values are scaled to [0, 255] range.
toWord8 :: Elevator e => e -> Word8
-- | Values are scaled to [0, 65535] range.
toWord16 :: Elevator e => e -> Word16
-- | Values are scaled to [0, 4294967295] range.
toWord32 :: Elevator e => e -> Word32
-- | Values are scaled to [0, 18446744073709551615] range.
toWord64 :: Elevator e => e -> Word64
-- | Values are scaled to [0.0, 1.0] range.
toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a
-- | Values are scaled from [0.0, 1.0] range.
fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e
-- | Values are scaled to [0.0, 1.0] range.
toFloat :: Elevator e => e -> Float
-- | Values are scaled to [0.0, 1.0] range.
toDouble :: Elevator e => e -> Double
-- | Values are scaled from [0.0, 1.0] range.
fromDouble :: Elevator e => Double -> e
-- | Division that works for integral types as well as floating points. May
-- throw an exception.
(//) :: Elevator e => e -> e -> e
infixl 7 //
-- | Clamp a value to [0, 1] range.
clamp01 :: RealFloat a => a -> a
class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where {
type family Components cs e :: Type;
}
-- | Convert a Color to a representation suitable for storage as an unboxed
-- element, usually a tuple of channels.
toComponents :: ColorModel cs e => Color cs e -> Components cs e
-- | Convert from an elemnt representation back to a Color.
fromComponents :: ColorModel cs e => Components cs e -> Color cs e
-- | Display the cs portion of the pixel. Color itself will not be
-- evaluated.
showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS
data Alpha cs
type family Opaque cs
-- | Add an alpha channel value to an opaque pixel
addAlpha :: Color cs e -> e -> Color (Alpha cs) e
-- | Get the alpha channel value for the pixel
getAlpha :: Color (Alpha cs) e -> e
-- | Change the alpha channel value for the pixel
setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e
-- | Get the opaque pixel value, while leaving alpha channel intact.
dropAlpha :: Color (Alpha cs) e -> Color cs e
-- | Change the alpha channel value for the pixel
modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e
-- | Change the opaque pixel value, while leaving alpha channel intact.
modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
class (Illuminant i, ColorModel (BaseModel cs) e, ColorModel cs e) => ColorSpace cs (i :: k) e | cs -> i where {
type family BaseModel cs :: Type;
type family BaseSpace cs :: Type;
type BaseSpace cs = cs;
}
-- | Drop color space down to the base color model
toBaseModel :: ColorSpace cs i e => Color cs e -> Color (BaseModel cs) e
-- | Drop color space down to the base color model
toBaseModel :: (ColorSpace cs i e, Coercible (Color cs e) (Color (BaseModel cs) e)) => Color cs e -> Color (BaseModel cs) e
-- | Promote color model to a color space
fromBaseModel :: ColorSpace cs i e => Color (BaseModel cs) e -> Color cs e
-- | Promote color model to a color space
fromBaseModel :: (ColorSpace cs i e, Coercible (Color (BaseModel cs) e) (Color cs e)) => Color (BaseModel cs) e -> Color cs e
toBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color cs e -> Color (BaseSpace cs) e
fromBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color (BaseSpace cs) e -> Color cs e
-- | Get the relative luminance of a color
luminance :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (Y i) a
toColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
toColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
fromColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
fromColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
-- | This is a data type that encodes a data point on the chromaticity
-- diagram
newtype Chromaticity i e
Chromaticity :: Color (CIExyY i) e -> Chromaticity i e
[chromaticityCIExyY] :: Chromaticity i e -> Color (CIExyY i) e
newtype Primary (i :: k) e
PrimaryChromaticity :: Chromaticity i e -> Primary (i :: k) e
[primaryChromaticity] :: Primary (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern Primary :: e -> e -> Primary i e
xPrimary :: Primary i e -> e
yPrimary :: Primary i e -> e
-- | Compute z = 1 - x - y of a Primary.
zPrimary :: Num e => Primary i e -> e
-- | Compute XYZ tristimulus of a Primary.
primaryXZ :: Fractional e => e -> Primary i e -> Color (XYZ i) e
-- | Compute normalized XYZ tristimulus of a Primary, where
-- Y = 1
primaryTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Primary i e -> Color (XYZ i) e
class (Typeable i, Typeable k, KnownNat (Temperature i)) => Illuminant (i :: k) where {
type family Temperature i :: n;
}
whitePoint :: (Illuminant i, RealFloat e) => WhitePoint i e
colorTemperature :: Illuminant i => CCT i
newtype WhitePoint (i :: k) e
WhitePointChromaticity :: Chromaticity i e -> WhitePoint (i :: k) e
[whitePointChromaticity] :: WhitePoint (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern WhitePoint :: e -> e -> WhitePoint i e
-- | x value of a WhitePoint
xWhitePoint :: WhitePoint i e -> e
-- | y value of a WhitePoint
yWhitePoint :: WhitePoint i e -> e
-- | Compute z value of a WhitePoint: z = 1 - x -
-- y
zWhitePoint :: Num e => WhitePoint i e -> e
-- | Compute XYZ tristimulus of a white point.
whitePointXZ :: Fractional e => e -> WhitePoint i e -> Color (XYZ i) e
-- | Compute a normalized XYZ tristimulus of a white point, where
-- Y = 1
whitePointTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Color (XYZ i) e
-- | Correlated color temperature (CCT) of a white point in Kelvin
newtype CCT (i :: k)
CCT :: Double -> CCT (i :: k)
[unCCT] :: CCT (i :: k) -> Double
-- | Relative Luminance of a color
data Y (i :: k)
-- | Constructor for Y with alpha channel.
pattern Y :: e -> Color (Y i) e
-- | Constructor for Y with alpha channel.
pattern YA :: e -> e -> Color (Alpha (Y i)) e
-- | The original color space CIE 1931 XYZ color space
data XYZ i
-- | Constructor for the most common XYZ color space
pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e
-- | Constructor for XYZ with alpha channel.
pattern ColorXYZA :: e -> e -> e -> e -> Color (Alpha (XYZ i)) e
-- | Alternative representation of the CIE 1931 XYZ color space
data CIExyY (i :: k)
-- | Constructor CIE xyY color space. It only requires x
-- and y, then Y part will always be equal to 1.
pattern ColorCIExy :: e -> e -> Color (CIExyY i) e
-- | Patttern match on the CIE xyY, 3rd argument Y is
-- always set to 1
pattern ColorCIExyY :: Num e => e -> e -> e -> Color (CIExyY i) e
showsColorModel :: ColorModel cs e => Color cs e -> ShowS
-- | A class with a set of functions that allow for changing precision by
-- shrinking and streatching the values.
class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e
maxValue :: Elevator e => e
minValue :: Elevator e => e
fieldFormat :: Elevator e => e -> FieldFormat
-- | This is a pretty printer for the value.
toShowS :: Elevator e => e -> ShowS
-- | This is a pretty printer for the value.
toShowS :: (Elevator e, PrintfArg e) => e -> ShowS
-- | Values are scaled to [0, 255] range.
toWord8 :: Elevator e => e -> Word8
-- | Values are scaled to [0, 65535] range.
toWord16 :: Elevator e => e -> Word16
-- | Values are scaled to [0, 4294967295] range.
toWord32 :: Elevator e => e -> Word32
-- | Values are scaled to [0, 18446744073709551615] range.
toWord64 :: Elevator e => e -> Word64
-- | Values are scaled to [0.0, 1.0] range.
toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a
-- | Values are scaled from [0.0, 1.0] range.
fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e
-- | Values are scaled to [0.0, 1.0] range.
toFloat :: Elevator e => e -> Float
-- | Values are scaled to [0.0, 1.0] range.
toDouble :: Elevator e => e -> Double
-- | Values are scaled from [0.0, 1.0] range.
fromDouble :: Elevator e => Double -> e
-- | Division that works for integral types as well as floating points. May
-- throw an exception.
(//) :: Elevator e => e -> e -> e
infixl 7 //
-- | Clamp a value to [0, 1] range.
clamp01 :: RealFloat a => a -> a
module Graphics.Color.Space.RGB
-- | Constructor for an RGB color space.
pattern ColorRGB :: RedGreenBlue cs i => e -> e -> e -> Color (cs l) e
-- | Constructor for an RGB color space with Alpha channel
pattern ColorRGBA :: RedGreenBlue cs i => e -> e -> e -> e -> Color (Alpha (cs l)) e
class Illuminant i => RedGreenBlue (cs :: Linearity -> Type) (i :: k) | cs -> i
-- | RGB primaries that are defined for the RGB color space, while point is
-- defined by the i type parameter
gamut :: (RedGreenBlue cs i, RealFloat e) => Gamut cs i e
transfer :: (RedGreenBlue cs i, RealFloat e) => e -> e
itransfer :: (RedGreenBlue cs i, RealFloat e) => e -> e
-- | Normalized primary matrix for this RGB color space. Default
-- implementation derives it from chromaticity
npm :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => NPM cs e
-- | Inverse normalized primary matrix for this RGB color space. Default
-- implementation derives it from chromaticity
inpm :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => INPM cs e
-- | Lift RGB color model into a RGB color space
mkColorRGB :: RedGreenBlue cs i => Color RGB e -> Color (cs l) e
-- | Lift RGB color model into a RGB color space
mkColorRGB :: (RedGreenBlue cs i, Coercible (Color RGB e) (Color (cs l) e)) => Color RGB e -> Color (cs l) e
-- | Drop RGB color space down to the RGB color model
unColorRGB :: RedGreenBlue cs i => Color (cs l) e -> Color RGB e
-- | Drop RGB color space down to the RGB color model
unColorRGB :: (RedGreenBlue cs i, Coercible (Color (cs l) e) (Color RGB e)) => Color (cs l) e -> Color RGB e
data Linearity
Linear :: Linearity
NonLinear :: Linearity
-- | Encoding color component transfer function (forward). Also known as
-- opto-electronic transfer function (OETF / OECF).
ecctf :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Color (cs 'Linear) e -> Color (cs 'NonLinear) e
-- | Decoding color component transfer function (inverse). Also known as
-- electro-optical transfer function (EOTF / EOCF).
dcctf :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Color (cs 'NonLinear) e -> Color (cs 'Linear) e
-- | RGB color space gamut specification.
data Gamut (cs :: Linearity -> Type) i e
Gamut :: !Primary i e -> !Primary i e -> !Primary i e -> Gamut (cs :: Linearity -> Type) i e
[gamutRedPrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
[gamutGreenPrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
[gamutBluePrimary] :: Gamut (cs :: Linearity -> Type) i e -> !Primary i e
-- | This function allows for creating a completely mismatched color space
-- spec. Make sure you know what you are doing, if you need to use it.
coerceGamut :: Gamut cs' i' e -> Gamut cs i e
rgb2xyz :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'NonLinear) e -> Color (XYZ i) e
rgbLinear2xyz :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'Linear) e -> Color (XYZ i) e
xyz2rgb :: (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (XYZ i) e -> Color (cs 'NonLinear) e
xyz2rgbLinear :: forall cs i e. (RedGreenBlue cs i, ColorSpace (cs 'NonLinear) i e, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (XYZ i) e -> Color (cs 'Linear) e
rgbLuminance :: (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'NonLinear) e -> Color (Y i) e
-- | Linear transformation of a color into a linear luminance, i.e. the Y
-- component of XYZ color space
rgbLinearLuminance :: forall cs i e. (RedGreenBlue cs i, ColorSpace (cs 'Linear) i e, RealFloat e) => Color (cs 'Linear) e -> Color (Y i) e
-- | Normalized primary matrix (NPM), which is used to tranform linear RGB
-- color space into XYZ color space.
newtype NPM cs e
NPM :: M3x3 e -> NPM cs e
[unNPM] :: NPM cs e -> M3x3 e
-- | Linear transformation of a pixel in a linear RGB color space into XYZ
-- color space
--
--
-- >>> :set -XDataKinds
--
-- >>> import Debug.Trace
--
-- >>> import Graphics.Color.Illuminant.CIE1931
--
-- >>> import Graphics.Color.Space.RGB.Derived.SRGB
--
-- >>> :{
-- srgbFromLinear :: Color (SRGB 'D65 'Linear) Float -> Color (XYZ 'D65) Float
-- srgbFromLinear = npmApply npm'
-- where npm' = trace "Evaluated only once!!!" npm :: NPM (SRGB 'D65) Float
-- :}
--
--
-- -- >>> srgbFromLinear $ ColorRGB 0.1 0.2 0.3 -- <XYZ CIE1931 'D65:(Evaluated only once!!! -- 0.16688849, 0.18595251, 0.31085595)> -- -- >>> srgbFromLinear $ ColorRGB 0.1 0.2 0.3 -- <XYZ CIE1931 'D65:( 0.16688849, 0.18595251, 0.31085595)> -- -- >>> rgb = ColorRGB 0.1 0.2 0.3 :: Color (SRGB 'D65 'Linear) Float -- -- >>> npmApply npm rgb :: Color (XYZ 'D65) Float -- <XYZ CIE1931 'D65:( 0.16688849, 0.18595251, 0.31085595)> ---- -- Here is a comparison with a non-liner sRGB conversion: -- --
-- >>> rgb = ColorRGB 0.1 0.2 0.3 :: Color (SRGB 'D65 'NonLinear) Float
--
-- >>> npmApply npm (dcctf rgb) :: Color (XYZ 'D65) Float {- non-linear transformation -}
-- <XYZ CIE1931 'D65:( 0.02918611, 0.03109305, 0.07373714)>
--
-- >>> toColorXYZ rgb :: Color (XYZ 'D65) Float {- non-linear transformation -}
-- <XYZ CIE1931 'D65:( 0.02918611, 0.03109305, 0.07373714)>
--
npmApply :: (RedGreenBlue cs i, Elevator e) => NPM cs e -> Color (cs 'Linear) e -> Color (XYZ i) e
-- | Derive a NPM form chromaticities and a white point
npmDerive :: forall cs i e. (ColorSpace (cs 'Linear) i e, RealFloat e) => Gamut cs i e -> NPM cs e
-- | Inverse normalized primary matrix (iNPM), which is used to tranform
-- linear XYZ color space into a linear RGB color space. It is
-- literally a inverse matrix of NPM
newtype INPM cs e
INPM :: M3x3 e -> INPM cs e
[unINPM] :: INPM cs e -> M3x3 e
-- | Linear transformation of a pixel in XYZ color space into a linear RGB
-- color space
inpmApply :: (RedGreenBlue cs i, Elevator e) => INPM cs e -> Color (XYZ i) e -> Color (cs 'Linear) e
-- | Derive an INPM form chromaticities and a white point
inpmDerive :: forall cs i e. (ColorSpace (cs 'Linear) i e, RealFloat e) => Gamut cs i e -> INPM cs e
-- | Get the Chromaticity of a pixel in RGB color space. Color
-- itself isn't actually evaluated, its type carries enough information
-- for this operation.
rgbColorGamut :: (RedGreenBlue cs i, RealFloat e) => Color (cs l) a -> Gamut cs i e
-- | Get the white point of any RGB pixel. Color itself isn't evaluated,
-- since its type carries enough information for getting the white point.
--
--
-- >>> import Graphics.Color.Space.RGB
--
-- >>> :set -XTypeApplications
--
-- >>> pixelWhitePoint @Float (ColorSRGB @Word8 1 2 3)
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D65:( 0.31270000, 0.32900000)>})
--
pixelWhitePoint :: forall e cs a i l. (RedGreenBlue cs i, RealFloat e) => Color (cs l) a -> WhitePoint i e
-- | Get the WhitePoint of chromaticity. Chromaticity itself
-- isn't actually evaluated, its type carries enough information for this
-- operation.
gamutWhitePoint :: forall cs e i. (RedGreenBlue cs i, RealFloat e) => Gamut cs i e -> WhitePoint i e
class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where {
type family Components cs e :: Type;
}
-- | Convert a Color to a representation suitable for storage as an unboxed
-- element, usually a tuple of channels.
toComponents :: ColorModel cs e => Color cs e -> Components cs e
-- | Convert from an elemnt representation back to a Color.
fromComponents :: ColorModel cs e => Components cs e -> Color cs e
-- | Display the cs portion of the pixel. Color itself will not be
-- evaluated.
showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS
data Alpha cs
type family Opaque cs
-- | Add an alpha channel value to an opaque pixel
addAlpha :: Color cs e -> e -> Color (Alpha cs) e
-- | Get the alpha channel value for the pixel
getAlpha :: Color (Alpha cs) e -> e
-- | Change the alpha channel value for the pixel
setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e
-- | Get the opaque pixel value, while leaving alpha channel intact.
dropAlpha :: Color (Alpha cs) e -> Color cs e
-- | Change the alpha channel value for the pixel
modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e
-- | Change the opaque pixel value, while leaving alpha channel intact.
modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
class (Illuminant i, ColorModel (BaseModel cs) e, ColorModel cs e) => ColorSpace cs (i :: k) e | cs -> i where {
type family BaseModel cs :: Type;
type family BaseSpace cs :: Type;
type BaseSpace cs = cs;
}
-- | Drop color space down to the base color model
toBaseModel :: ColorSpace cs i e => Color cs e -> Color (BaseModel cs) e
-- | Drop color space down to the base color model
toBaseModel :: (ColorSpace cs i e, Coercible (Color cs e) (Color (BaseModel cs) e)) => Color cs e -> Color (BaseModel cs) e
-- | Promote color model to a color space
fromBaseModel :: ColorSpace cs i e => Color (BaseModel cs) e -> Color cs e
-- | Promote color model to a color space
fromBaseModel :: (ColorSpace cs i e, Coercible (Color (BaseModel cs) e) (Color cs e)) => Color (BaseModel cs) e -> Color cs e
toBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color cs e -> Color (BaseSpace cs) e
fromBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color (BaseSpace cs) e -> Color cs e
-- | Get the relative luminance of a color
luminance :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (Y i) a
toColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
toColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
fromColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
fromColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
-- | This is a data type that encodes a data point on the chromaticity
-- diagram
newtype Chromaticity i e
Chromaticity :: Color (CIExyY i) e -> Chromaticity i e
[chromaticityCIExyY] :: Chromaticity i e -> Color (CIExyY i) e
newtype Primary (i :: k) e
PrimaryChromaticity :: Chromaticity i e -> Primary (i :: k) e
[primaryChromaticity] :: Primary (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern Primary :: e -> e -> Primary i e
xPrimary :: Primary i e -> e
yPrimary :: Primary i e -> e
-- | Compute z = 1 - x - y of a Primary.
zPrimary :: Num e => Primary i e -> e
-- | Compute XYZ tristimulus of a Primary.
primaryXZ :: Fractional e => e -> Primary i e -> Color (XYZ i) e
-- | Compute normalized XYZ tristimulus of a Primary, where
-- Y = 1
primaryTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Primary i e -> Color (XYZ i) e
class (Typeable i, Typeable k, KnownNat (Temperature i)) => Illuminant (i :: k) where {
type family Temperature i :: n;
}
whitePoint :: (Illuminant i, RealFloat e) => WhitePoint i e
colorTemperature :: Illuminant i => CCT i
newtype WhitePoint (i :: k) e
WhitePointChromaticity :: Chromaticity i e -> WhitePoint (i :: k) e
[whitePointChromaticity] :: WhitePoint (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern WhitePoint :: e -> e -> WhitePoint i e
-- | x value of a WhitePoint
xWhitePoint :: WhitePoint i e -> e
-- | y value of a WhitePoint
yWhitePoint :: WhitePoint i e -> e
-- | Compute z value of a WhitePoint: z = 1 - x -
-- y
zWhitePoint :: Num e => WhitePoint i e -> e
-- | Compute XYZ tristimulus of a white point.
whitePointXZ :: Fractional e => e -> WhitePoint i e -> Color (XYZ i) e
-- | Compute a normalized XYZ tristimulus of a white point, where
-- Y = 1
whitePointTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Color (XYZ i) e
-- | Correlated color temperature (CCT) of a white point in Kelvin
newtype CCT (i :: k)
CCT :: Double -> CCT (i :: k)
[unCCT] :: CCT (i :: k) -> Double
-- | Relative Luminance of a color
data Y (i :: k)
-- | Constructor for Y with alpha channel.
pattern Y :: e -> Color (Y i) e
-- | Constructor for Y with alpha channel.
pattern YA :: e -> e -> Color (Alpha (Y i)) e
-- | The original color space CIE 1931 XYZ color space
data XYZ i
-- | Constructor for the most common XYZ color space
pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e
-- | Constructor for XYZ with alpha channel.
pattern ColorXYZA :: e -> e -> e -> e -> Color (Alpha (XYZ i)) e
-- | Alternative representation of the CIE 1931 XYZ color space
data CIExyY (i :: k)
-- | Constructor CIE xyY color space. It only requires x
-- and y, then Y part will always be equal to 1.
pattern ColorCIExy :: e -> e -> Color (CIExyY i) e
-- | Patttern match on the CIE xyY, 3rd argument Y is
-- always set to 1
pattern ColorCIExyY :: Num e => e -> e -> e -> Color (CIExyY i) e
showsColorModel :: ColorModel cs e => Color cs e -> ShowS
-- | A class with a set of functions that allow for changing precision by
-- shrinking and streatching the values.
class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e
maxValue :: Elevator e => e
minValue :: Elevator e => e
fieldFormat :: Elevator e => e -> FieldFormat
-- | This is a pretty printer for the value.
toShowS :: Elevator e => e -> ShowS
-- | This is a pretty printer for the value.
toShowS :: (Elevator e, PrintfArg e) => e -> ShowS
-- | Values are scaled to [0, 255] range.
toWord8 :: Elevator e => e -> Word8
-- | Values are scaled to [0, 65535] range.
toWord16 :: Elevator e => e -> Word16
-- | Values are scaled to [0, 4294967295] range.
toWord32 :: Elevator e => e -> Word32
-- | Values are scaled to [0, 18446744073709551615] range.
toWord64 :: Elevator e => e -> Word64
-- | Values are scaled to [0.0, 1.0] range.
toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a
-- | Values are scaled from [0.0, 1.0] range.
fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e
-- | Values are scaled to [0.0, 1.0] range.
toFloat :: Elevator e => e -> Float
-- | Values are scaled to [0.0, 1.0] range.
toDouble :: Elevator e => e -> Double
-- | Values are scaled from [0.0, 1.0] range.
fromDouble :: Elevator e => Double -> e
-- | Division that works for integral types as well as floating points. May
-- throw an exception.
(//) :: Elevator e => e -> e -> e
infixl 7 //
-- | Clamp a value to [0, 1] range.
clamp01 :: RealFloat a => a -> a
class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where {
type family Components cs e :: Type;
}
-- | Convert a Color to a representation suitable for storage as an unboxed
-- element, usually a tuple of channels.
toComponents :: ColorModel cs e => Color cs e -> Components cs e
-- | Convert from an elemnt representation back to a Color.
fromComponents :: ColorModel cs e => Components cs e -> Color cs e
-- | Display the cs portion of the pixel. Color itself will not be
-- evaluated.
showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS
data Alpha cs
type family Opaque cs
-- | Add an alpha channel value to an opaque pixel
addAlpha :: Color cs e -> e -> Color (Alpha cs) e
-- | Get the alpha channel value for the pixel
getAlpha :: Color (Alpha cs) e -> e
-- | Change the alpha channel value for the pixel
setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e
-- | Get the opaque pixel value, while leaving alpha channel intact.
dropAlpha :: Color (Alpha cs) e -> Color cs e
-- | Change the alpha channel value for the pixel
modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e
-- | Change the opaque pixel value, while leaving alpha channel intact.
modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
class (Illuminant i, ColorModel (BaseModel cs) e, ColorModel cs e) => ColorSpace cs (i :: k) e | cs -> i where {
type family BaseModel cs :: Type;
type family BaseSpace cs :: Type;
type BaseSpace cs = cs;
}
-- | Drop color space down to the base color model
toBaseModel :: ColorSpace cs i e => Color cs e -> Color (BaseModel cs) e
-- | Drop color space down to the base color model
toBaseModel :: (ColorSpace cs i e, Coercible (Color cs e) (Color (BaseModel cs) e)) => Color cs e -> Color (BaseModel cs) e
-- | Promote color model to a color space
fromBaseModel :: ColorSpace cs i e => Color (BaseModel cs) e -> Color cs e
-- | Promote color model to a color space
fromBaseModel :: (ColorSpace cs i e, Coercible (Color (BaseModel cs) e) (Color cs e)) => Color (BaseModel cs) e -> Color cs e
toBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color cs e -> Color (BaseSpace cs) e
fromBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color (BaseSpace cs) e -> Color cs e
-- | Get the relative luminance of a color
luminance :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (Y i) a
toColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
toColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
fromColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
fromColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
-- | This is a data type that encodes a data point on the chromaticity
-- diagram
newtype Chromaticity i e
Chromaticity :: Color (CIExyY i) e -> Chromaticity i e
[chromaticityCIExyY] :: Chromaticity i e -> Color (CIExyY i) e
newtype Primary (i :: k) e
PrimaryChromaticity :: Chromaticity i e -> Primary (i :: k) e
[primaryChromaticity] :: Primary (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern Primary :: e -> e -> Primary i e
xPrimary :: Primary i e -> e
yPrimary :: Primary i e -> e
-- | Compute z = 1 - x - y of a Primary.
zPrimary :: Num e => Primary i e -> e
-- | Compute XYZ tristimulus of a Primary.
primaryXZ :: Fractional e => e -> Primary i e -> Color (XYZ i) e
-- | Compute normalized XYZ tristimulus of a Primary, where
-- Y = 1
primaryTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Primary i e -> Color (XYZ i) e
class (Typeable i, Typeable k, KnownNat (Temperature i)) => Illuminant (i :: k) where {
type family Temperature i :: n;
}
whitePoint :: (Illuminant i, RealFloat e) => WhitePoint i e
colorTemperature :: Illuminant i => CCT i
newtype WhitePoint (i :: k) e
WhitePointChromaticity :: Chromaticity i e -> WhitePoint (i :: k) e
[whitePointChromaticity] :: WhitePoint (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern WhitePoint :: e -> e -> WhitePoint i e
-- | x value of a WhitePoint
xWhitePoint :: WhitePoint i e -> e
-- | y value of a WhitePoint
yWhitePoint :: WhitePoint i e -> e
-- | Compute z value of a WhitePoint: z = 1 - x -
-- y
zWhitePoint :: Num e => WhitePoint i e -> e
-- | Compute XYZ tristimulus of a white point.
whitePointXZ :: Fractional e => e -> WhitePoint i e -> Color (XYZ i) e
-- | Compute a normalized XYZ tristimulus of a white point, where
-- Y = 1
whitePointTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Color (XYZ i) e
-- | Correlated color temperature (CCT) of a white point in Kelvin
newtype CCT (i :: k)
CCT :: Double -> CCT (i :: k)
[unCCT] :: CCT (i :: k) -> Double
-- | Relative Luminance of a color
data Y (i :: k)
-- | Constructor for Y with alpha channel.
pattern Y :: e -> Color (Y i) e
-- | Constructor for Y with alpha channel.
pattern YA :: e -> e -> Color (Alpha (Y i)) e
-- | The original color space CIE 1931 XYZ color space
data XYZ i
-- | Constructor for the most common XYZ color space
pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e
-- | Constructor for XYZ with alpha channel.
pattern ColorXYZA :: e -> e -> e -> e -> Color (Alpha (XYZ i)) e
-- | Alternative representation of the CIE 1931 XYZ color space
data CIExyY (i :: k)
-- | Constructor CIE xyY color space. It only requires x
-- and y, then Y part will always be equal to 1.
pattern ColorCIExy :: e -> e -> Color (CIExyY i) e
-- | Patttern match on the CIE xyY, 3rd argument Y is
-- always set to 1
pattern ColorCIExyY :: Num e => e -> e -> e -> Color (CIExyY i) e
showsColorModel :: ColorModel cs e => Color cs e -> ShowS
-- | A class with a set of functions that allow for changing precision by
-- shrinking and streatching the values.
class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e
maxValue :: Elevator e => e
minValue :: Elevator e => e
fieldFormat :: Elevator e => e -> FieldFormat
-- | This is a pretty printer for the value.
toShowS :: Elevator e => e -> ShowS
-- | This is a pretty printer for the value.
toShowS :: (Elevator e, PrintfArg e) => e -> ShowS
-- | Values are scaled to [0, 255] range.
toWord8 :: Elevator e => e -> Word8
-- | Values are scaled to [0, 65535] range.
toWord16 :: Elevator e => e -> Word16
-- | Values are scaled to [0, 4294967295] range.
toWord32 :: Elevator e => e -> Word32
-- | Values are scaled to [0, 18446744073709551615] range.
toWord64 :: Elevator e => e -> Word64
-- | Values are scaled to [0.0, 1.0] range.
toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a
-- | Values are scaled from [0.0, 1.0] range.
fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e
-- | Values are scaled to [0.0, 1.0] range.
toFloat :: Elevator e => e -> Float
-- | Values are scaled to [0.0, 1.0] range.
toDouble :: Elevator e => e -> Double
-- | Values are scaled from [0.0, 1.0] range.
fromDouble :: Elevator e => Double -> e
-- | Division that works for integral types as well as floating points. May
-- throw an exception.
(//) :: Elevator e => e -> e -> e
infixl 7 //
-- | Clamp a value to [0, 1] range.
clamp01 :: RealFloat a => a -> a
module Graphics.Color.Space
-- | Convert a color space through XYZ intermediary with
-- Double precision. Illuminant is enforced to be the same, but in
-- case that it is a limitation and chromatic adaptation is needed
-- convert can be used instead.
convertColor :: forall cs cs' i e. (ColorSpace cs' i e, ColorSpace cs i e) => Color cs' e -> Color cs e
-- | Same as convertColor, but use 32bit Float as an
-- intermediary precision
convertColorFloat :: forall cs cs' i e. (ColorSpace cs' i e, ColorSpace cs i e) => Color cs' e -> Color cs e
class (Functor (Color cs), Applicative (Color cs), Foldable (Color cs), Traversable (Color cs), Eq (Color cs e), Show (Color cs e), Unbox (Components cs e), Storable (Color cs e), Typeable cs, Elevator e, Typeable (Opaque cs)) => ColorModel cs e where {
type family Components cs e :: Type;
}
-- | Convert a Color to a representation suitable for storage as an unboxed
-- element, usually a tuple of channels.
toComponents :: ColorModel cs e => Color cs e -> Components cs e
-- | Convert from an elemnt representation back to a Color.
fromComponents :: ColorModel cs e => Components cs e -> Color cs e
-- | Display the cs portion of the pixel. Color itself will not be
-- evaluated.
showsColorModelName :: ColorModel cs e => Proxy (Color cs e) -> ShowS
data Alpha cs
type family Opaque cs
-- | Add an alpha channel value to an opaque pixel
addAlpha :: Color cs e -> e -> Color (Alpha cs) e
-- | Get the alpha channel value for the pixel
getAlpha :: Color (Alpha cs) e -> e
-- | Change the alpha channel value for the pixel
setAlpha :: Color (Alpha cs) e -> e -> Color (Alpha cs) e
-- | Get the opaque pixel value, while leaving alpha channel intact.
dropAlpha :: Color (Alpha cs) e -> Color cs e
-- | Change the alpha channel value for the pixel
modifyAlpha :: (e -> e) -> Color (Alpha cs) e -> Color (Alpha cs) e
-- | Change the opaque pixel value, while leaving alpha channel intact.
modifyOpaque :: (Color cs e -> Color cs' e) -> Color (Alpha cs) e -> Color (Alpha cs') e
-- | A Color family with a color space and a precision of elements.
data family Color cs e :: Type
class (Illuminant i, ColorModel (BaseModel cs) e, ColorModel cs e) => ColorSpace cs (i :: k) e | cs -> i where {
type family BaseModel cs :: Type;
type family BaseSpace cs :: Type;
type BaseSpace cs = cs;
}
-- | Drop color space down to the base color model
toBaseModel :: ColorSpace cs i e => Color cs e -> Color (BaseModel cs) e
-- | Drop color space down to the base color model
toBaseModel :: (ColorSpace cs i e, Coercible (Color cs e) (Color (BaseModel cs) e)) => Color cs e -> Color (BaseModel cs) e
-- | Promote color model to a color space
fromBaseModel :: ColorSpace cs i e => Color (BaseModel cs) e -> Color cs e
-- | Promote color model to a color space
fromBaseModel :: (ColorSpace cs i e, Coercible (Color (BaseModel cs) e) (Color cs e)) => Color (BaseModel cs) e -> Color cs e
toBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color cs e -> Color (BaseSpace cs) e
fromBaseSpace :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e) => Color (BaseSpace cs) e -> Color cs e
-- | Get the relative luminance of a color
luminance :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (Y i) a
toColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
toColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color cs e -> Color (XYZ i) a
fromColorXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
fromColorXYZ :: (ColorSpace cs i e, ColorSpace (BaseSpace cs) i e, Elevator a, RealFloat a) => Color (XYZ i) a -> Color cs e
-- | This is a data type that encodes a data point on the chromaticity
-- diagram
newtype Chromaticity i e
Chromaticity :: Color (CIExyY i) e -> Chromaticity i e
[chromaticityCIExyY] :: Chromaticity i e -> Color (CIExyY i) e
newtype Primary (i :: k) e
PrimaryChromaticity :: Chromaticity i e -> Primary (i :: k) e
[primaryChromaticity] :: Primary (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern Primary :: e -> e -> Primary i e
xPrimary :: Primary i e -> e
yPrimary :: Primary i e -> e
-- | Compute z = 1 - x - y of a Primary.
zPrimary :: Num e => Primary i e -> e
-- | Compute XYZ tristimulus of a Primary.
primaryXZ :: Fractional e => e -> Primary i e -> Color (XYZ i) e
-- | Compute normalized XYZ tristimulus of a Primary, where
-- Y = 1
primaryTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Primary i e -> Color (XYZ i) e
class (Typeable i, Typeable k, KnownNat (Temperature i)) => Illuminant (i :: k) where {
type family Temperature i :: n;
}
whitePoint :: (Illuminant i, RealFloat e) => WhitePoint i e
colorTemperature :: Illuminant i => CCT i
newtype WhitePoint (i :: k) e
WhitePointChromaticity :: Chromaticity i e -> WhitePoint (i :: k) e
[whitePointChromaticity] :: WhitePoint (i :: k) e -> Chromaticity i e
-- | Constructor for the most common XYZ color space
pattern WhitePoint :: e -> e -> WhitePoint i e
-- | x value of a WhitePoint
xWhitePoint :: WhitePoint i e -> e
-- | y value of a WhitePoint
yWhitePoint :: WhitePoint i e -> e
-- | Compute z value of a WhitePoint: z = 1 - x -
-- y
zWhitePoint :: Num e => WhitePoint i e -> e
-- | Compute XYZ tristimulus of a white point.
whitePointXZ :: Fractional e => e -> WhitePoint i e -> Color (XYZ i) e
-- | Compute a normalized XYZ tristimulus of a white point, where
-- Y = 1
whitePointTristimulus :: forall i e. (Illuminant i, RealFloat e, Elevator e) => Color (XYZ i) e
-- | Correlated color temperature (CCT) of a white point in Kelvin
newtype CCT (i :: k)
CCT :: Double -> CCT (i :: k)
[unCCT] :: CCT (i :: k) -> Double
-- | Relative Luminance of a color
data Y (i :: k)
-- | Constructor for Y with alpha channel.
pattern Y :: e -> Color (Y i) e
-- | Constructor for Y with alpha channel.
pattern YA :: e -> e -> Color (Alpha (Y i)) e
-- | The original color space CIE 1931 XYZ color space
data XYZ i
-- | Constructor for the most common XYZ color space
pattern ColorXYZ :: e -> e -> e -> Color (XYZ i) e
-- | Constructor for XYZ with alpha channel.
pattern ColorXYZA :: e -> e -> e -> e -> Color (Alpha (XYZ i)) e
-- | Alternative representation of the CIE 1931 XYZ color space
data CIExyY (i :: k)
-- | Constructor CIE xyY color space. It only requires x
-- and y, then Y part will always be equal to 1.
pattern ColorCIExy :: e -> e -> Color (CIExyY i) e
-- | Patttern match on the CIE xyY, 3rd argument Y is
-- always set to 1
pattern ColorCIExyY :: Num e => e -> e -> e -> Color (CIExyY i) e
showsColorModel :: ColorModel cs e => Color cs e -> ShowS
-- | A class with a set of functions that allow for changing precision by
-- shrinking and streatching the values.
class (Show e, Eq e, Num e, Typeable e, Unbox e, Storable e) => Elevator e
maxValue :: Elevator e => e
minValue :: Elevator e => e
fieldFormat :: Elevator e => e -> FieldFormat
-- | This is a pretty printer for the value.
toShowS :: Elevator e => e -> ShowS
-- | This is a pretty printer for the value.
toShowS :: (Elevator e, PrintfArg e) => e -> ShowS
-- | Values are scaled to [0, 255] range.
toWord8 :: Elevator e => e -> Word8
-- | Values are scaled to [0, 65535] range.
toWord16 :: Elevator e => e -> Word16
-- | Values are scaled to [0, 4294967295] range.
toWord32 :: Elevator e => e -> Word32
-- | Values are scaled to [0, 18446744073709551615] range.
toWord64 :: Elevator e => e -> Word64
-- | Values are scaled to [0.0, 1.0] range.
toRealFloat :: (Elevator e, Elevator a, RealFloat a) => e -> a
-- | Values are scaled from [0.0, 1.0] range.
fromRealFloat :: (Elevator e, Elevator a, RealFloat a) => a -> e
-- | Values are scaled to [0.0, 1.0] range.
toFloat :: Elevator e => e -> Float
-- | Values are scaled to [0.0, 1.0] range.
toDouble :: Elevator e => e -> Double
-- | Values are scaled from [0.0, 1.0] range.
fromDouble :: Elevator e => Double -> e
-- | Division that works for integral types as well as floating points. May
-- throw an exception.
(//) :: Elevator e => e -> e -> e
infixl 7 //
-- | Clamp a value to [0, 1] range.
clamp01 :: RealFloat a => a -> a
module Graphics.Color.Standard.RAL
-- | Source: https://en.wikipedia.org/wiki/List_of_RAL_colors
data RAL (n :: k)
RAL :: RAL (n :: k)
-- | This is an approximation of CIE1931 D50 white point defined in
-- ICC PCS. Useful for chromatic adaptation.
--
--
-- >>> whitePoint :: WhitePoint D50 Double
-- WhitePoint (Chromaticity {chromaticityCIExyY = <CIExyY * D50:( 0.3457029149190000, 0.3585385966800000)>})
--
-- >>> whitePointTristimulus :: Color (XYZ D50) Float
-- <XYZ * D50:( 0.96420000, 1.00000000, 0.82490010)>
--
-- >>> colorTemperature :: CCT D50
-- CCT {unCCT = 5003.0}
--
data D50
greenBeige :: ColorSpace cs i e => Color cs e
beige :: ColorSpace cs i e => Color cs e
sandYellow :: ColorSpace cs i e => Color cs e
signalYellow :: ColorSpace cs i e => Color cs e
goldenYellow :: ColorSpace cs i e => Color cs e
honeyYellow :: ColorSpace cs i e => Color cs e
maizeYellow :: ColorSpace cs i e => Color cs e
daffodilYellow :: ColorSpace cs i e => Color cs e
brownBeige :: ColorSpace cs i e => Color cs e
lemonYellow :: ColorSpace cs i e => Color cs e
oysterWhite :: ColorSpace cs i e => Color cs e
ivory :: ColorSpace cs i e => Color cs e
lightIvory :: ColorSpace cs i e => Color cs e
sulfurYellow :: ColorSpace cs i e => Color cs e
saffronYellow :: ColorSpace cs i e => Color cs e
zincYellow :: ColorSpace cs i e => Color cs e
greyBeige :: ColorSpace cs i e => Color cs e
oliveYellow :: ColorSpace cs i e => Color cs e
rapeYellow :: ColorSpace cs i e => Color cs e
trafficYellow :: ColorSpace cs i e => Color cs e
ochreYellow :: ColorSpace cs i e => Color cs e
luminousYellow :: ColorSpace cs i e => Color cs e
curryYellow :: ColorSpace cs i e => Color cs e
melonYellow :: ColorSpace cs i e => Color cs e
broomYellow :: ColorSpace cs i e => Color cs e
dahliaYellow :: ColorSpace cs i e => Color cs e
pastelYellow :: ColorSpace cs i e => Color cs e
pearlBeige :: ColorSpace cs i e => Color cs e
pearlGold :: ColorSpace cs i e => Color cs e
sunYellow :: ColorSpace cs i e => Color cs e
yellowOrange :: ColorSpace cs i e => Color cs e
redOrange :: ColorSpace cs i e => Color cs e
vermilion :: ColorSpace cs i e => Color cs e
pastelOrange :: ColorSpace cs i e => Color cs e
pureOrange :: ColorSpace cs i e => Color cs e
luminousOrange :: ColorSpace cs i e => Color cs e
luminousBrightOrange :: ColorSpace cs i e => Color cs e
brightRedOrange :: ColorSpace cs i e => Color cs e
trafficOrange :: ColorSpace cs i e => Color cs e
signalOrange :: ColorSpace cs i e => Color cs e
deepOrange :: ColorSpace cs i e => Color cs e
salmonOrange :: ColorSpace cs i e => Color cs e
pearlOrange :: ColorSpace cs i e => Color cs e
flameRed :: ColorSpace cs i e => Color cs e
signalRed :: ColorSpace cs i e => Color cs e
carmineRed :: ColorSpace cs i e => Color cs e
rubyRed :: ColorSpace cs i e => Color cs e
purpleRed :: ColorSpace cs i e => Color cs e
wineRed :: ColorSpace cs i e => Color cs e
blackRed :: ColorSpace cs i e => Color cs e
oxideRed :: ColorSpace cs i e => Color cs e
brownRed :: ColorSpace cs i e => Color cs e
beigeRed :: ColorSpace cs i e => Color cs e
tomatoRed :: ColorSpace cs i e => Color cs e
antiquePink :: ColorSpace cs i e => Color cs e
lightPink :: ColorSpace cs i e => Color cs e
coralRed :: ColorSpace cs i e => Color cs e
rose :: ColorSpace cs i e => Color cs e
strawberryRed :: ColorSpace cs i e => Color cs e
trafficRed :: ColorSpace cs i e => Color cs e
salmonPink :: ColorSpace cs i e => Color cs e
luminousRed :: ColorSpace cs i e => Color cs e
luminousBrightRed :: ColorSpace cs i e => Color cs e
raspberryRed :: ColorSpace cs i e => Color cs e
pureRed :: ColorSpace cs i e => Color cs e
orientRed :: ColorSpace cs i e => Color cs e
pearlRubyRed :: ColorSpace cs i e => Color cs e
pearlPink :: ColorSpace cs i e => Color cs e
redLilac :: ColorSpace cs i e => Color cs e
redViolet :: ColorSpace cs i e => Color cs e
heatherViolet :: ColorSpace cs i e => Color cs e
claretViolet :: ColorSpace cs i e => Color cs e
blueLilac :: ColorSpace cs i e => Color cs e
trafficPurple :: ColorSpace cs i e => Color cs e
purpleViolet :: ColorSpace cs i e => Color cs e
signalViolet :: ColorSpace cs i e => Color cs e
pastelViolet :: ColorSpace cs i e => Color cs e
telemagenta :: ColorSpace cs i e => Color cs e
pearlViolet :: ColorSpace cs i e => Color cs e
pearlBlackberry :: ColorSpace cs i e => Color cs e
violetBlue :: ColorSpace cs i e => Color cs e
greenBlue :: ColorSpace cs i e => Color cs e
ultramarineBlue :: ColorSpace cs i e => Color cs e
sapphireBlue :: ColorSpace cs i e => Color cs e
blackBlue :: ColorSpace cs i e => Color cs e
signalBlue :: ColorSpace cs i e => Color cs e
brilliantBlue :: ColorSpace cs i e => Color cs e
greyBlue :: ColorSpace cs i e => Color cs e
azureBlue :: ColorSpace cs i e => Color cs e
gentianBlue :: ColorSpace cs i e => Color cs e
steelBlue :: ColorSpace cs i e => Color cs e
lightBlue :: ColorSpace cs i e => Color cs e
cobaltBlue :: ColorSpace cs i e => Color cs e
pigeonBlue :: ColorSpace cs i e => Color cs e
skyBlue :: ColorSpace cs i e => Color cs e
trafficBlue :: ColorSpace cs i e => Color cs e
turquoiseBlue :: ColorSpace cs i e => Color cs e
capriBlue :: ColorSpace cs i e => Color cs e
oceanBlue :: ColorSpace cs i e => Color cs e
waterBlue :: ColorSpace cs i e => Color cs e
nightBlue :: ColorSpace cs i e => Color cs e
distantBlue :: ColorSpace cs i e => Color cs e
pastelBlue :: ColorSpace cs i e => Color cs e
pearlGentianBlue :: ColorSpace cs i e => Color cs e
pearlNightBlue :: ColorSpace cs i e => Color cs e
patinaGreen :: ColorSpace cs i e => Color cs e
emeraldGreen :: ColorSpace cs i e => Color cs e
leafGreen :: ColorSpace cs i e => Color cs e
oliveGreen :: ColorSpace cs i e => Color cs e
blueGreen :: ColorSpace cs i e => Color cs e
mossGreen :: ColorSpace cs i e => Color cs e
greyOlive :: ColorSpace cs i e => Color cs e
bottleGreen :: ColorSpace cs i e => Color cs e
brownGreen :: ColorSpace cs i e => Color cs e
firGreen :: ColorSpace cs i e => Color cs e
grassGreen :: ColorSpace cs i e => Color cs e
resedaGreen :: ColorSpace cs i e => Color cs e
blackGreen :: ColorSpace cs i e => Color cs e
reedGreen :: ColorSpace cs i e => Color cs e
yellowOlive :: ColorSpace cs i e => Color cs e
blackOlive :: ColorSpace cs i e => Color cs e
turquoiseGreen :: ColorSpace cs i e => Color cs e
mayGreen :: ColorSpace cs i e => Color cs e
yellowGreen :: ColorSpace cs i e => Color cs e
pastelGreen :: ColorSpace cs i e => Color cs e
chromeGreen :: ColorSpace cs i e => Color cs e
paleGreen :: ColorSpace cs i e => Color cs e
oliveDrab :: ColorSpace cs i e => Color cs e
trafficGreen :: ColorSpace cs i e => Color cs e
fernGreen :: ColorSpace cs i e => Color cs e
opalGreen :: ColorSpace cs i e => Color cs e
lightGreen :: ColorSpace cs i e => Color cs e
pineGreen :: ColorSpace cs i e => Color cs e
mintGreen :: ColorSpace cs i e => Color cs e
signalGreen :: ColorSpace cs i e => Color cs e
mintTurquoise :: ColorSpace cs i e => Color cs e
pastelTurquoise :: ColorSpace cs i e => Color cs e
pearlGreen :: ColorSpace cs i e => Color cs e
pearlOpalGreen :: ColorSpace cs i e => Color cs e
pureGreen :: ColorSpace cs i e => Color cs e
luminousGreen :: ColorSpace cs i e => Color cs e
squirrelGrey :: ColorSpace cs i e => Color cs e
silverGrey :: ColorSpace cs i e => Color cs e
oliveGrey :: ColorSpace cs i e => Color cs e
mossGrey :: ColorSpace cs i e => Color cs e
signalGrey :: ColorSpace cs i e => Color cs e
mouseGrey :: ColorSpace cs i e => Color cs e
beigeGrey :: ColorSpace cs i e => Color cs e
khakiGrey :: ColorSpace cs i e => Color cs e
greenGrey :: ColorSpace cs i e => Color cs e
tarpaulinGrey :: ColorSpace cs i e => Color cs e
ironGrey :: ColorSpace cs i e => Color cs e
basaltGrey :: ColorSpace cs i e => Color cs e
brownGrey :: ColorSpace cs i e => Color cs e
slateGrey :: ColorSpace cs i e => Color cs e
anthraciteGrey :: ColorSpace cs i e => Color cs e
blackGrey :: ColorSpace cs i e => Color cs e
umbraGrey :: ColorSpace cs i e => Color cs e
concreteGrey :: ColorSpace cs i e => Color cs e
graphiteGrey :: ColorSpace cs i e => Color cs e
graniteGrey :: ColorSpace cs i e => Color cs e
stoneGrey :: ColorSpace cs i e => Color cs e
blueGrey :: ColorSpace cs i e => Color cs e
pebbleGrey :: ColorSpace cs i e => Color cs e
cementGrey :: ColorSpace cs i e => Color cs e
yellowGrey :: ColorSpace cs i e => Color cs e
lightGrey :: ColorSpace cs i e => Color cs e
platinumGrey :: ColorSpace cs i e => Color cs e
dustyGrey :: ColorSpace cs i e => Color cs e
agateGrey :: ColorSpace cs i e => Color cs e
quartzGrey :: ColorSpace cs i e => Color cs e
windowGrey :: ColorSpace cs i e => Color cs e
trafficGreyA :: ColorSpace cs i e => Color cs e
trafficGreyB :: ColorSpace cs i e => Color cs e
silkGrey :: ColorSpace cs i e => Color cs e
telegrey1 :: ColorSpace cs i e => Color cs e
telegrey2 :: ColorSpace cs i e => Color cs e
telegrey4 :: ColorSpace cs i e => Color cs e
pearlMouseGrey :: ColorSpace cs i e => Color cs e
greenBrown :: ColorSpace cs i e => Color cs e
ochreBrown :: ColorSpace cs i e => Color cs e
signalBrown :: ColorSpace cs i e => Color cs e
clayBrown :: ColorSpace cs i e => Color cs e
copperBrown :: ColorSpace cs i e => Color cs e
fawnBrown :: ColorSpace cs i e => Color cs e
oliveBrown :: ColorSpace cs i e => Color cs e
nutBrown :: ColorSpace cs i e => Color cs e
redBrown :: ColorSpace cs i e => Color cs e
sepiaBrown :: ColorSpace cs i e => Color cs e
chestnutBrown :: ColorSpace cs i e => Color cs e
mahoganyBrown :: ColorSpace cs i e => Color cs e
chocolateBrown :: ColorSpace cs i e => Color cs e
greyBrown :: ColorSpace cs i e => Color cs e
blackBrown :: ColorSpace cs i e => Color cs e
orangeBrown :: ColorSpace cs i e => Color cs e
beigeBrown :: ColorSpace cs i e => Color cs e
paleBrown :: ColorSpace cs i e => Color cs e
terraBrown :: ColorSpace cs i e => Color cs e
pearlCopper :: ColorSpace cs i e => Color cs e
cream :: ColorSpace cs i e => Color cs e
greyWhite :: ColorSpace cs i e => Color cs e
signalWhite :: ColorSpace cs i e => Color cs e
signalBlack :: ColorSpace cs i e => Color cs e
jetBlack :: ColorSpace cs i e => Color cs e
whiteAluminium :: ColorSpace cs i e => Color cs e
greyAluminium :: ColorSpace cs i e => Color cs e
pureWhite :: ColorSpace cs i e => Color cs e
graphiteBlack :: ColorSpace cs i e => Color cs e
trafficWhite :: ColorSpace cs i e => Color cs e
trafficBlack :: ColorSpace cs i e => Color cs e
papyrusWhite :: ColorSpace cs i e => Color cs e
pearlLightGrey :: ColorSpace cs i e => Color cs e
pearlDarkGrey :: ColorSpace cs i e => Color cs e
class StandardColor std code
color :: (StandardColor std code, ColorSpace cs i e) => std code -> Color cs e
instance forall k (n :: k). (Data.Typeable.Internal.Typeable n, Data.Typeable.Internal.Typeable k) => GHC.Show.Show (Graphics.Color.Standard.RAL.RAL n)
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1006
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1014
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1018
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1019
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1020
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1021
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1023
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1026
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1027
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1028
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1032
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1033
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1034
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1035
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1036
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 1037
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 2013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3014
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3018
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3020
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3026
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3027
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3028
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3031
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3032
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 3033
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4006
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 4012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5014
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5018
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5019
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5020
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5021
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5023
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5025
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 5026
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6006
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6014
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6018
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6019
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6020
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6021
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6025
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6026
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6027
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6028
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6029
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6032
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6033
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6034
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6035
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6036
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6037
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 6038
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7006
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7009
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7013
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7021
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7023
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7026
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7030
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7031
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7032
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7033
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7034
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7035
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7036
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7037
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7038
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7039
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7040
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7042
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7043
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7044
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7045
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7046
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7047
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 7048
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8000
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8008
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8012
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8014
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8015
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8019
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8023
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8024
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8025
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8028
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 8029
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9001
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9002
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9003
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9004
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9005
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9006
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9007
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9010
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9011
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9016
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9017
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9018
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9022
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL 9023
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Green beige"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Beige"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sand yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Golden yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Honey yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Maize yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Daffodil yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brown beige"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Lemon yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Oyster white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ivory"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Light ivory"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sulfur yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Saffron yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Zinc yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey beige"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Olive yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Rape yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ochre yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Curry yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Melon yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Broom yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Dahlia yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl beige"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl gold"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sun yellow"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Yellow orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Red orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Vermilion"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pure orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous bright orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Bright red orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Deep orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Salmon orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl orange"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Flame red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Carmine red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ruby red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Purple red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Wine red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Oxide red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brown red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Beige red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Tomato red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Antique pink"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Light pink"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Coral red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Rose"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Strawberry red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Salmon pink"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous bright red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Raspberry red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pure red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Orient red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl ruby red"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl pink"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Red lilac"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Red violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Heather violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Claret violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Blue lilac"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic purple"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Purple violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Telemagenta"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl violet"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl blackberry"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Violet blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Green blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ultramarine blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sapphire blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brilliant blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Azure blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Gentian blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Steel blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Light blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Cobalt blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pigeon blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sky blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Turquoise blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Capri blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ocean blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Water blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Night blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Distant blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl gentian blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl night blue"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Patina green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Emerald green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Leaf green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Olive green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Blue green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Moss green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey olive"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Bottle green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brown green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Fir green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grass green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Reseda green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Reed green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Yellow olive"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black olive"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Turquoise green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "May green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Yellow green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Chrome green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pale green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Olive-drab"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brown olive"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Fern green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Opal green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Light green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pine green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Mint green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Mint turquoise"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pastel turquoise"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl opal green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pure green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Luminous green"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Squirrel grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Silver grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Olive grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Moss grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Mouse grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Beige grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Khaki grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Green grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Tarpaulin grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Iron grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Basalt grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Brown grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "NATO olive"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Slate grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Anthracite grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Umbra grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Concrete grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Graphite grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Granite grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Stone grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Blue grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pebble grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Cement grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Yellow grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Light grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Platinum grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Dusty grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Agate grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Quartz grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Window grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic grey A"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic grey B"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Silk grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Telegrey 1"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Telegrey 2"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Telegrey 4"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl mouse grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Green brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Ochre brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Clay brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Copper brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Fawn brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Olive brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Nut brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Red brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Sepia brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Chestnut brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Mahogany brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Chocolate brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Black brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Orange brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Beige brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pale brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Terra brown"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl copper"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Cream"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Signal black"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Jet black"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "White aluminium"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Grey aluminium"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pure white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Graphite black"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Traffic black"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Papyrus white"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl light grey"
instance Graphics.Color.Standard.RAL.StandardColor Graphics.Color.Standard.RAL.RAL "Pearl dark grey"
module Graphics.Pixel.ColorSpace
-- | Digital imaging is one of the most common places for a color to be
-- used in. The smallest element in any image is a pixel, which is
-- defined by its color.
newtype Pixel cs e
Pixel :: Color cs e -> Pixel cs e
-- | Constructor for a pixel with Luminance
pattern PixelY :: e -> Pixel (Y i) e
-- | Constructor for a pixel in CIE1931 XYZ color space
pattern PixelXYZ :: e -> e -> e -> Pixel (XYZ i) e
-- | Constructor for a pixel in CIE1976 LAB color space
pattern PixelLAB :: e -> e -> e -> Pixel (LAB i) e
-- | Constructor for a pixel in RGB color space.
pattern PixelRGB :: RedGreenBlue cs (i :: k) => e -> e -> e -> Pixel (cs l) e
-- | Constructor for a pixel in HSI.
pattern PixelHSI :: e -> e -> e -> Pixel (HSI cs) e
-- | Constructor for a pixel in HSL.
pattern PixelHSL :: e -> e -> e -> Pixel (HSL cs) e
-- | Constructor for a pixel in HSV.
pattern PixelHSV :: e -> e -> e -> Pixel (HSV cs) e
-- | Constructor for a pixel in CMYK.
pattern PixelCMYK :: e -> e -> e -> e -> Pixel (CMYK cs) e
-- | Constructor for a pixel in Y'CbCr.
pattern PixelY'CbCr :: e -> e -> e -> Pixel (Y'CbCr cs) e
-- | Constructor for a pixel with Luma (not to be confused with luminance
-- Y)
pattern PixelY' :: e -> Pixel (Y' cs) e
-- | Constructor for a pixel with Luminance and Alpha channel
pattern PixelYA :: e -> e -> Pixel (Alpha (Y i)) e
-- | Constructor for a pixel in CIE1931 XYZ color space with Alpha
-- channel
pattern PixelXYZA :: e -> e -> e -> e -> Pixel (Alpha (XYZ i)) e
-- | Constructor for a pixel in CIE1976 LAB color space with Alpha
-- channel
pattern PixelLABA :: e -> e -> e -> e -> Pixel (Alpha (LAB i)) e
-- | Constructor for a pixel in RGB color space with Alpha channel
pattern PixelRGBA :: RedGreenBlue cs i => e -> e -> e -> e -> Pixel (Alpha (cs l)) e
-- | Constructor for a pixel in HSI with alpha channel.
pattern PixelHSIA :: e -> e -> e -> e -> Pixel (Alpha (HSI cs)) e
-- | Constructor for a pixel in HSL with alpha channel.
pattern PixelHSLA :: e -> e -> e -> e -> Pixel (Alpha (HSL cs)) e
-- | Constructor for a pixel in HSV with alpha channel.
pattern PixelHSVA :: e -> e -> e -> e -> Pixel (Alpha (HSV cs)) e
-- | Constructor for a pixel in CMYK with alpha channel.
pattern PixelCMYKA :: e -> e -> e -> e -> e -> Pixel (Alpha (CMYK cs)) e
-- | Constructor for a pixel in Y'CbCr with alpha channel.
pattern PixelY'CbCrA :: e -> e -> e -> e -> Pixel (Alpha (Y'CbCr cs)) e
-- | Constructor for a pixel with Luma and Alpha channel (not to be
-- confused with luminance Y)
pattern PixelY'A :: e -> e -> Pixel (Alpha (Y' cs)) e
-- | Apply a function to Pixel's Color
liftPixel :: (Color cs e -> Color cs' e') -> Pixel cs e -> Pixel cs' e'
-- | Get to the underlying Color
pixelColor :: Pixel cs e -> Color cs e
-- | Convert a pixel from one color space to any other.
--
-- -- >>> :set -XDataKinds -- -- >>> :set -XTypeApplications -- -- >>> px = PixelSRGB @Float 0.0 0.5 1.0 -- -- >>> px -- <SRGB 'NonLinear:( 0.00000000, 0.50000000, 1.00000000)> -- -- >>> convertPixel @(AdobeRGB 'NonLinear) @_ @Word8 px -- <AdobeRGB 'NonLinear:( 71,127,251)> --convertPixel :: forall cs i e cs' i' e'. (ColorSpace cs' i' e', ColorSpace cs i e) => Pixel cs' e' -> Pixel cs e -- | Compute luminance of a pixel color toPixelY :: ColorSpace cs i e => Pixel cs e -> Pixel (Y i) e -- | Convert to CIE1931 XYZ color space, with the same illuminant as the -- original. toPixelXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Pixel cs e -> Pixel (XYZ i) a -- | Convert from CIE1931 XYZ color space, with the same illuminant as the -- target color space. fromPixelXYZ :: (ColorSpace cs i e, Elevator a, RealFloat a) => Pixel (XYZ i) a -> Pixel cs e -- | Convert pixel in an alternative representation of color space, to its -- base color space. Example from CMYK to SRGB toPixelBaseSpace :: (ColorSpace cs i e, bcs ~ BaseSpace cs, ColorSpace bcs i e) => Pixel cs e -> Pixel bcs e -- | Covert a color space of a pixel into it's alternative representation. -- Example AdobeRGB to HSI. fromPixelBaseSpace :: (ColorSpace cs i e, bcs ~ BaseSpace cs, ColorSpace bcs i e) => Pixel bcs e -> Pixel cs e -- | Drop all color space information and only keep the values encoded in -- the fitting color model, which the color space is backed by. toPixelBaseModel :: ColorSpace cs i e => Pixel cs e -> Pixel (BaseModel cs) e -- | Promote a pixel without color space information to a color space that -- is backed by the fitting color model fromPixelBaseModel :: ColorSpace cs i e => Pixel (BaseModel cs) e -> Pixel cs e -- | Convert all channels of a pixel to 8bits each, while doing appropriate -- scaling. See Elevator. toPixel8 :: ColorModel cs e => Pixel cs e -> Pixel cs Word8 -- | Convert all channels of a pixel to 16bits each, while appropriate -- scaling. See Elevator. toPixel16 :: ColorModel cs e => Pixel cs e -> Pixel cs Word16 -- | Convert all channels of a pixel to 32bits each, while doing -- appropriate scaling. See Elevator. toPixel32 :: ColorModel cs e => Pixel cs e -> Pixel cs Word32 -- | Convert all channels of a pixel to 64bits each, while doing -- appropriate scaling. See Elevator. toPixel64 :: ColorModel cs e => Pixel cs e -> Pixel cs Word64 -- | Convert all channels of a pixel to 32bit floating point numers each, -- while doing appropriate scaling. See Elevator. toPixelF :: ColorModel cs e => Pixel cs e -> Pixel cs Float -- | Convert all channels of a pixel to 64bit floating point numers each, -- while doing appropriate scaling. See Elevator. toPixelD :: ColorModel cs e => Pixel cs e -> Pixel cs Double -- | Convert non-linear RGB color space into linear one toPixelLinearRGB :: (RedGreenBlue cs i, RealFloat e) => Pixel (cs 'NonLinear) e -> Pixel (cs 'Linear) e -- | Convert linear RGB color space into a non-linear one fromPixelLinearRGB :: (RedGreenBlue cs i, RealFloat e) => Pixel (cs 'Linear) e -> Pixel (cs 'NonLinear) e -- | Constructor for a pixel in sRGB color space pattern PixelSRGB :: e -> e -> e -> Pixel (SRGB 'NonLinear) e -- | Constructor for a pixel in sRGB color space with Alpha -- channel pattern PixelSRGBA :: e -> e -> e -> e -> Pixel (Alpha (SRGB 'NonLinear)) e -- | Convert an RGB pixel to Y` if it has the weights specified with -- Luma. rgbPixelLuma :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Pixel (cs 'NonLinear) e' -> Pixel (Y' cs) e module Graphics.Pixel -- | Digital imaging is one of the most common places for a color to be -- used in. The smallest element in any image is a pixel, which is -- defined by its color. newtype Pixel cs e Pixel :: Color cs e -> Pixel cs e -- | Constructor for a grayscale pixel with single channel. pattern PixelX :: e -> Pixel X e -- | Constructor for a pixel with RGB color model. pattern PixelRGB :: e -> e -> e -> Pixel RGB e -- | Constructor for Pixel with HSI color model. pattern PixelHSI :: e -> e -> e -> Pixel HSI e -- | Constructor for Pixel with HSL color model. pattern PixelHSL :: e -> e -> e -> Pixel HSL e -- | Constructor for Pixel with HSV color model. pattern PixelHSV :: e -> e -> e -> Pixel HSV e -- | Constructor for a pixel with CMYK color model. pattern PixelCMYK :: e -> e -> e -> e -> Pixel CMYK e -- | Constructor for a pixel with YCbCr color model. pattern PixelYCbCr :: e -> e -> e -> Pixel YCbCr e -- | Constructor for a grayscale pixel with a transparency channel. pattern PixelXA :: e -> e -> Pixel (Alpha X) e -- | Constructor for a pixel with RGB color model and Alpha -- channel. pattern PixelRGBA :: e -> e -> e -> e -> Pixel (Alpha RGB) e -- | Constructor for a pixel with HSI color model and Alpha -- channel. pattern PixelHSIA :: e -> e -> e -> e -> Pixel (Alpha HSI) e -- | Constructor for a pixel with HSL color model and Alpha -- channel. pattern PixelHSLA :: e -> e -> e -> e -> Pixel (Alpha HSL) e -- | Constructor for a pixel with HSV color model and Alpha -- channel. pattern PixelHSVA :: e -> e -> e -> e -> Pixel (Alpha HSV) e -- | Constructor for a pixel with CMYK color model and Alpha -- channel. pattern PixelCMYKA :: e -> e -> e -> e -> e -> Pixel (Alpha CMYK) e -- | Constructor for a pixel with YCbCr color model and Alpha -- channel. pattern PixelYCbCrA :: e -> e -> e -> e -> Pixel (Alpha YCbCr) e -- | Apply a function to Pixel's Color liftPixel :: (Color cs e -> Color cs' e') -> Pixel cs e -> Pixel cs' e' -- | Get to the underlying Color pixelColor :: Pixel cs e -> Color cs e -- | Convert all channels of a pixel to 8bits each, while doing appropriate -- scaling. See Elevator. toPixel8 :: ColorModel cs e => Pixel cs e -> Pixel cs Word8 -- | Convert all channels of a pixel to 16bits each, while appropriate -- scaling. See Elevator. toPixel16 :: ColorModel cs e => Pixel cs e -> Pixel cs Word16 -- | Convert all channels of a pixel to 32bits each, while doing -- appropriate scaling. See Elevator. toPixel32 :: ColorModel cs e => Pixel cs e -> Pixel cs Word32 -- | Convert all channels of a pixel to 64bits each, while doing -- appropriate scaling. See Elevator. toPixel64 :: ColorModel cs e => Pixel cs e -> Pixel cs Word64 -- | Convert all channels of a pixel to 32bit floating point numers each, -- while doing appropriate scaling. See Elevator. toPixelF :: ColorModel cs e => Pixel cs e -> Pixel cs Float -- | Convert all channels of a pixel to 64bit floating point numers each, -- while doing appropriate scaling. See Elevator. toPixelD :: ColorModel cs e => Pixel cs e -> Pixel cs Double