@@ -213,8 +213,9 @@ setLineCap Round = setLineCapImpl "round"
213
213
setLineCap Square = setLineCapImpl " square"
214
214
setLineCap Butt = setLineCapImpl " butt"
215
215
216
- -- | Enumerates the different types of alpha composite operations.
216
+ -- | Enumerates the different types of composite operations and blend modes .
217
217
data Composite
218
+ -- Composite Operations
218
219
= SourceOver
219
220
| SourceIn
220
221
| SourceOut
@@ -227,6 +228,23 @@ data Composite
227
228
| Copy
228
229
| Xor
229
230
231
+ -- Blend Modes
232
+ | Multiply
233
+ | Screen
234
+ | Overlay
235
+ | Darken
236
+ | Lighten
237
+ | ColorDodge
238
+ | ColorBurn
239
+ | HardLight
240
+ | SoftLight
241
+ | Difference
242
+ | Exclusion
243
+ | Hue
244
+ | Saturation
245
+ | Color
246
+ | Luminosity
247
+
230
248
instance showComposite :: Show Composite where
231
249
show SourceOver = " SourceOver"
232
250
show SourceIn = " SourceIn"
@@ -239,6 +257,21 @@ instance showComposite :: Show Composite where
239
257
show Lighter = " Lighter"
240
258
show Copy = " Copy"
241
259
show Xor = " Xor"
260
+ show Multiply = " Multiply"
261
+ show Screen = " Screen"
262
+ show Overlay = " Overlay"
263
+ show Darken = " Darken"
264
+ show Lighten = " Lighten"
265
+ show ColorDodge = " ColorDodge"
266
+ show ColorBurn = " ColorBurn"
267
+ show HardLight = " HardLight"
268
+ show SoftLight = " SoftLight"
269
+ show Difference = " Difference"
270
+ show Exclusion = " Exclusion"
271
+ show Hue = " Hue"
272
+ show Saturation = " Saturation"
273
+ show Color = " Color"
274
+ show Luminosity = " Luminosity"
242
275
243
276
foreign import setGlobalCompositeOperationImpl :: forall eff . Context2D -> String -> Eff (canvas :: Canvas | eff ) Context2D
244
277
@@ -257,6 +290,21 @@ setGlobalCompositeOperation ctx composite = setGlobalCompositeOperationImpl ctx
257
290
toString Lighter = " lighter"
258
291
toString Copy = " copy"
259
292
toString Xor = " xor"
293
+ toString Multiply = " multiply"
294
+ toString Screen = " screen"
295
+ toString Overlay = " overlay"
296
+ toString Darken = " darken"
297
+ toString Lighten = " lighten"
298
+ toString ColorDodge = " color-dodge"
299
+ toString ColorBurn = " color-burn"
300
+ toString HardLight = " hard-light"
301
+ toString SoftLight = " soft-light"
302
+ toString Difference = " difference"
303
+ toString Exclusion = " exclusion"
304
+ toString Hue = " hue"
305
+ toString Saturation = " saturation"
306
+ toString Color = " color"
307
+ toString Luminosity = " luminosity"
260
308
261
309
-- | Set the current global alpha level.
262
310
foreign import setGlobalAlpha :: forall eff . Context2D -> Number -> Eff (canvas :: Canvas | eff ) Context2D
0 commit comments