@@ -213,8 +213,9 @@ setLineCap Round = setLineCapImpl "round"
213213setLineCap Square = setLineCapImpl " square"
214214setLineCap Butt = setLineCapImpl " butt"
215215
216- -- | Enumerates the different types of alpha composite operations.
216+ -- | Enumerates the different types of composite operations and blend modes .
217217data Composite
218+ -- Composite Operations
218219 = SourceOver
219220 | SourceIn
220221 | SourceOut
@@ -227,6 +228,23 @@ data Composite
227228 | Copy
228229 | Xor
229230
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+
230248instance showComposite :: Show Composite where
231249 show SourceOver = " SourceOver"
232250 show SourceIn = " SourceIn"
@@ -239,6 +257,21 @@ instance showComposite :: Show Composite where
239257 show Lighter = " Lighter"
240258 show Copy = " Copy"
241259 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"
242275
243276foreign import setGlobalCompositeOperationImpl :: forall eff . Context2D -> String -> Eff (canvas :: Canvas | eff ) Context2D
244277
@@ -257,6 +290,21 @@ setGlobalCompositeOperation ctx composite = setGlobalCompositeOperationImpl ctx
257290 toString Lighter = " lighter"
258291 toString Copy = " copy"
259292 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"
260308
261309-- | Set the current global alpha level.
262310foreign import setGlobalAlpha :: forall eff . Context2D -> Number -> Eff (canvas :: Canvas | eff ) Context2D
0 commit comments