I'm new to this library and I want a way to operate a (for example) Pixel RGB Double like:
p <- <RGB:(1.0e-2|9.80392156862745e-4|9.900990099009901e-3)>
I know substracts or sums affects the whole RGB
pixel p = p + 1
<RGB:(1.01|1.0009803921568627|1.00990099009901)>
Is there a way to operate the Red, Blue or Green part alone instead of operate the three colors at once?
For
RGB
, the data declaration looks like this:The three fields are the red, green, and blue fields, respectively. So you can do all the usual Haskell-y things like pattern matching and reconstructing. For example:
The data declarations for other instances of this data family are shown at the top of the main documentation page.