Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public enum BlendMode
- Object
- Enum<BlendMode>
- 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
NORMAL | The layer covers what is below it. |
MULTIPLY | Multiplies the two colors, so the result is always darker. |
SCREEN | Inverts, multiplies and inverts again, so the result is always lighter. |
OVERLAY | Multiply or screen, depending on the color below. |
DARKEN | Keeps the darker of the two colors. |
LIGHTEN | Keeps the lighter of the two colors. |
COLOR_DODGE | Brightens what is below to reflect the layer. |
COLOR_BURN | Darkens what is below to reflect the layer. |
HARD_LIGHT | Multiply or screen, depending on the layer’s color. |
SOFT_LIGHT | A softer form of hard light. |
DIFFERENCE | The absolute difference of the two colors. |
EXCLUSION | Like difference, with lower contrast. |
HUE | The layer’s hue, with the saturation and luminosity below. |
SATURATION | The layer’s saturation, with the hue and luminosity below. |
COLOR | The layer’s hue and saturation, with the luminosity below. |
LUMINOSITY | The layer’s luminosity, with the hue and saturation below. |
LINEAR_BURN | Adds the two colors and subtracts white: darker than multiply. |
LINEAR_DODGE | Adds the two colors: brighter than screen (Photoshop’s “add”). |
VIVID_LIGHT | Color burn or color dodge, depending on the layer’s color. |
LINEAR_LIGHT | Linear burn or linear dodge, depending on the layer’s color. |
PIN_LIGHT | Darken or lighten, depending on the layer’s color. |
HARD_MIX | Each channel goes to 0 or 1: the threshold of vivid light. |
SUBTRACT | Subtracts the layer from what is below. |
DIVIDE | Divides what is below by the layer. |
DARKER_COLOR | Keeps whichever whole color, the layer’s or the one below, has the lower luminosity. |
LIGHTER_COLOR | Keeps whichever whole color has the higher luminosity. |
DISSOLVE | Shows each pixel of the layer fully or not at all, at random, in proportion to its opacity. |
PLUS_LIGHTER | Adds colors and opacities, clamped: the plus-lighter of CSS, Sketch and Figma. |
PLUS_DARKER | Subtracts 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
NORMALThe layer covers what is below it.
MULTIPLY
MULTIPLYMultiplies the two colors, so the result is always darker.
SCREEN
SCREENInverts, multiplies and inverts again, so the result is always lighter.
OVERLAY
OVERLAYMultiply or screen, depending on the color below.
DARKEN
DARKENKeeps the darker of the two colors.
LIGHTEN
LIGHTENKeeps the lighter of the two colors.
COLOR_DODGE
COLOR_DODGEBrightens what is below to reflect the layer.
COLOR_BURN
COLOR_BURNDarkens what is below to reflect the layer.
HARD_LIGHT
HARD_LIGHTMultiply or screen, depending on the layer’s color.
SOFT_LIGHT
SOFT_LIGHTA softer form of hard light.
DIFFERENCE
DIFFERENCEThe absolute difference of the two colors.
EXCLUSION
EXCLUSIONLike difference, with lower contrast.
HUE
HUEThe layer’s hue, with the saturation and luminosity below.
SATURATION
SATURATIONThe layer’s saturation, with the hue and luminosity below.
COLOR
COLORThe layer’s hue and saturation, with the luminosity below.
LUMINOSITY
LUMINOSITYThe layer’s luminosity, with the hue and saturation below.
LINEAR_BURN
LINEAR_BURNAdds the two colors and subtracts white: darker than multiply.
LINEAR_DODGE
LINEAR_DODGEAdds the two colors: brighter than screen (Photoshop’s “add”).
VIVID_LIGHT
VIVID_LIGHTColor burn or color dodge, depending on the layer’s color.
LINEAR_LIGHT
LINEAR_LIGHTLinear burn or linear dodge, depending on the layer’s color.
PIN_LIGHT
PIN_LIGHTDarken or lighten, depending on the layer’s color.
HARD_MIX
HARD_MIXEach channel goes to 0 or 1: the threshold of vivid light.
SUBTRACT
SUBTRACTSubtracts the layer from what is below.
DIVIDE
DIVIDEDivides what is below by the layer.
DARKER_COLOR
DARKER_COLORKeeps whichever whole color, the layer’s or the one below, has the lower luminosity.
LIGHTER_COLOR
LIGHTER_COLORKeeps whichever whole color has the higher luminosity.
DISSOLVE
DISSOLVEShows each pixel of the layer fully or not at all, at random, in proportion to its
opacity.
PLUS_LIGHTER
PLUS_LIGHTERAdds colors and opacities, clamped: the
plus-lighter of CSS, Sketch and Figma.PLUS_DARKER
PLUS_DARKERSubtracts 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.