Enum BlendMode

java.lang.Object
java.lang.Enum<BlendMode>
com.codename1.art.BlendMode
All Implemented Interfaces:
Comparable<BlendMode>

public enum BlendMode extends Enum<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 Constant Summary

    Enum Constants
    Enum Constant
    Description
    The layer's hue and saturation, with the luminosity below.
    Darkens what is below to reflect the layer.
    Brightens what is below to reflect the layer.
    Keeps the darker of the two colors.
    Keeps whichever whole color, the layer's or the one below, has the lower luminosity.
    The absolute difference of the two colors.
    Shows each pixel of the layer fully or not at all, at random, in proportion to its opacity.
    Divides what is below by the layer.
    Like difference, with lower contrast.
    Multiply or screen, depending on the layer's color.
    Each channel goes to 0 or 1: the threshold of vivid light.
    The layer's hue, with the saturation and luminosity below.
    Keeps the lighter of the two colors.
    Keeps whichever whole color has the higher luminosity.
    Adds the two colors and subtracts white: darker than multiply.
    Adds the two colors: brighter than screen (Photoshop's "add").
    Linear burn or linear dodge, depending on the layer's color.
    The layer's luminosity, with the hue and saturation below.
    Multiplies the two colors, so the result is always darker.
    The layer covers what is below it.
    Multiply or screen, depending on the color below.
    Darken or lighten, depending on the layer's color.
    Subtracts the inverses of the colors from white, adding opacities: Sketch's plus-darker.
    Adds colors and opacities, clamped: the plus-lighter of CSS, Sketch and Figma.
    The layer's saturation, with the hue and luminosity below.
    Inverts, multiplies and inverts again, so the result is always lighter.
    A softer form of hard light.
    Subtracts the layer from what is below.
    Color burn or color dodge, depending on the layer's color.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true when this mode looks at all three color channels together, rather than blending each channel by itself.
    static BlendMode
    Returns the enum constant of this type with the specified name.
    static BlendMode[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NORMAL

      public static final BlendMode NORMAL
      The layer covers what is below it.
    • MULTIPLY

      public static final BlendMode MULTIPLY
      Multiplies the two colors, so the result is always darker.
    • SCREEN

      public static final BlendMode SCREEN
      Inverts, multiplies and inverts again, so the result is always lighter.
    • OVERLAY

      public static final BlendMode OVERLAY
      Multiply or screen, depending on the color below.
    • DARKEN

      public static final BlendMode DARKEN
      Keeps the darker of the two colors.
    • LIGHTEN

      public static final BlendMode LIGHTEN
      Keeps the lighter of the two colors.
    • COLOR_DODGE

      public static final BlendMode COLOR_DODGE
      Brightens what is below to reflect the layer.
    • COLOR_BURN

      public static final BlendMode COLOR_BURN
      Darkens what is below to reflect the layer.
    • HARD_LIGHT

      public static final BlendMode HARD_LIGHT
      Multiply or screen, depending on the layer's color.
    • SOFT_LIGHT

      public static final BlendMode SOFT_LIGHT
      A softer form of hard light.
    • DIFFERENCE

      public static final BlendMode DIFFERENCE
      The absolute difference of the two colors.
    • EXCLUSION

      public static final BlendMode EXCLUSION
      Like difference, with lower contrast.
    • HUE

      public static final BlendMode HUE
      The layer's hue, with the saturation and luminosity below.
    • SATURATION

      public static final BlendMode SATURATION
      The layer's saturation, with the hue and luminosity below.
    • COLOR

      public static final BlendMode COLOR
      The layer's hue and saturation, with the luminosity below.
    • LUMINOSITY

      public static final BlendMode LUMINOSITY
      The layer's luminosity, with the hue and saturation below.
    • LINEAR_BURN

      public static final BlendMode LINEAR_BURN
      Adds the two colors and subtracts white: darker than multiply.
    • LINEAR_DODGE

      public static final BlendMode LINEAR_DODGE
      Adds the two colors: brighter than screen (Photoshop's "add").
    • VIVID_LIGHT

      public static final BlendMode VIVID_LIGHT
      Color burn or color dodge, depending on the layer's color.
    • LINEAR_LIGHT

      public static final BlendMode LINEAR_LIGHT
      Linear burn or linear dodge, depending on the layer's color.
    • PIN_LIGHT

      public static final BlendMode PIN_LIGHT
      Darken or lighten, depending on the layer's color.
    • HARD_MIX

      public static final BlendMode HARD_MIX
      Each channel goes to 0 or 1: the threshold of vivid light.
    • SUBTRACT

      public static final BlendMode SUBTRACT
      Subtracts the layer from what is below.
    • DIVIDE

      public static final BlendMode DIVIDE
      Divides what is below by the layer.
    • DARKER_COLOR

      public static final BlendMode DARKER_COLOR
      Keeps whichever whole color, the layer's or the one below, has the lower luminosity.
    • LIGHTER_COLOR

      public static final BlendMode LIGHTER_COLOR
      Keeps whichever whole color has the higher luminosity.
    • DISSOLVE

      public static final BlendMode DISSOLVE
      Shows each pixel of the layer fully or not at all, at random, in proportion to its opacity.
    • PLUS_LIGHTER

      public static final BlendMode PLUS_LIGHTER
      Adds colors and opacities, clamped: the plus-lighter of CSS, Sketch and Figma.
    • PLUS_DARKER

      public static final BlendMode PLUS_DARKER
      Subtracts the inverses of the colors from white, adding opacities: Sketch's plus-darker.
  • Method Details

    • values

      public static BlendMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BlendMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isNonSeparable

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