Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public enum BlendMode

  1. Object
  2. Enum<BlendMode>
  3. BlendMode

ImplementsComparable<BlendMode>

How a layer’s colors combine with what is already painted below it.

The first sixteen are the modes of the W3C Compositing and Blending specification, which PSD, Sketch, Figma and SVG’s mix-blend-mode all share. The rest are Photoshop’s additional modes and the additive modes of CSS, Sketch and Figma.

Enum constants

NORMALThe layer covers what is below it.
MULTIPLYMultiplies the two colors, so the result is always darker.
SCREENInverts, multiplies and inverts again, so the result is always lighter.
OVERLAYMultiply or screen, depending on the color below.
DARKENKeeps the darker of the two colors.
LIGHTENKeeps the lighter of the two colors.
COLOR_DODGEBrightens what is below to reflect the layer.
COLOR_BURNDarkens what is below to reflect the layer.
HARD_LIGHTMultiply or screen, depending on the layer’s color.
SOFT_LIGHTA softer form of hard light.
DIFFERENCEThe absolute difference of the two colors.
EXCLUSIONLike difference, with lower contrast.
HUEThe layer’s hue, with the saturation and luminosity below.
SATURATIONThe layer’s saturation, with the hue and luminosity below.
COLORThe layer’s hue and saturation, with the luminosity below.
LUMINOSITYThe layer’s luminosity, with the hue and saturation below.
LINEAR_BURNAdds the two colors and subtracts white: darker than multiply.
LINEAR_DODGEAdds the two colors: brighter than screen (Photoshop’s “add”).
VIVID_LIGHTColor burn or color dodge, depending on the layer’s color.
LINEAR_LIGHTLinear burn or linear dodge, depending on the layer’s color.
PIN_LIGHTDarken or lighten, depending on the layer’s color.
HARD_MIXEach channel goes to 0 or 1: the threshold of vivid light.
SUBTRACTSubtracts the layer from what is below.
DIVIDEDivides what is below by the layer.
DARKER_COLORKeeps whichever whole color, the layer’s or the one below, has the lower luminosity.
LIGHTER_COLORKeeps whichever whole color has the higher luminosity.
DISSOLVEShows each pixel of the layer fully or not at all, at random, in proportion to its opacity.
PLUS_LIGHTERAdds colors and opacities, clamped: the plus-lighter of CSS, Sketch and Figma.
PLUS_DARKERSubtracts the inverses of the colors from white, adding opacities: Sketch’s plus-darker.

Methods

public static BlendMode[] values()
public static BlendMode valueOf(String name)
public boolean isNonSeparable()Returns true when this mode looks at all three color channels together, rather than blending each channel by itself.

Inherited methods

Enum constant details

NORMAL

NORMAL
The layer covers what is below it.

MULTIPLY

MULTIPLY
Multiplies the two colors, so the result is always darker.

SCREEN

SCREEN
Inverts, multiplies and inverts again, so the result is always lighter.

OVERLAY

OVERLAY
Multiply or screen, depending on the color below.

DARKEN

DARKEN
Keeps the darker of the two colors.

LIGHTEN

LIGHTEN
Keeps the lighter of the two colors.

COLOR_DODGE

COLOR_DODGE
Brightens what is below to reflect the layer.

COLOR_BURN

COLOR_BURN
Darkens what is below to reflect the layer.

HARD_LIGHT

HARD_LIGHT
Multiply or screen, depending on the layer’s color.

SOFT_LIGHT

SOFT_LIGHT
A softer form of hard light.

DIFFERENCE

DIFFERENCE
The absolute difference of the two colors.

EXCLUSION

EXCLUSION
Like difference, with lower contrast.

HUE

HUE
The layer’s hue, with the saturation and luminosity below.

SATURATION

SATURATION
The layer’s saturation, with the hue and luminosity below.

COLOR

COLOR
The layer’s hue and saturation, with the luminosity below.

LUMINOSITY

LUMINOSITY
The layer’s luminosity, with the hue and saturation below.

LINEAR_BURN

LINEAR_BURN
Adds the two colors and subtracts white: darker than multiply.

LINEAR_DODGE

LINEAR_DODGE
Adds the two colors: brighter than screen (Photoshop’s “add”).

VIVID_LIGHT

VIVID_LIGHT
Color burn or color dodge, depending on the layer’s color.

LINEAR_LIGHT

LINEAR_LIGHT
Linear burn or linear dodge, depending on the layer’s color.

PIN_LIGHT

PIN_LIGHT
Darken or lighten, depending on the layer’s color.

HARD_MIX

HARD_MIX
Each channel goes to 0 or 1: the threshold of vivid light.

SUBTRACT

SUBTRACT
Subtracts the layer from what is below.

DIVIDE

DIVIDE
Divides what is below by the layer.

DARKER_COLOR

DARKER_COLOR
Keeps whichever whole color, the layer’s or the one below, has the lower luminosity.

LIGHTER_COLOR

LIGHTER_COLOR
Keeps whichever whole color has the higher luminosity.

DISSOLVE

DISSOLVE
Shows each pixel of the layer fully or not at all, at random, in proportion to its opacity.

PLUS_LIGHTER

PLUS_LIGHTER
Adds colors and opacities, clamped: the plus-lighter of CSS, Sketch and Figma.

PLUS_DARKER

PLUS_DARKER
Subtracts the inverses of the colors from white, adding opacities: Sketch’s plus-darker.

Method details

values

public static BlendMode[] values()

valueOf

public static BlendMode valueOf(String name)

isNonSeparable

public boolean isNonSeparable()
Returns true when this mode looks at all three color channels together, rather than blending each channel by itself.