MCPcopy Create free account
hub / github.com/benfry/processing4 / blendColor

Method blendColor

core/src/processing/core/PImage.java:1599–1618  ·  view source on GitHub ↗

Blends two color values together based on the blending mode given as the MODE parameter. The possible modes are described in the reference for the blend() function. Advanced REPLACE - destination colour equals colour of source pixel: C = A. Sometimes called "Norm

(int c1, int c2, int mode)

Source from the content-addressed store, hash-verified

1597 * @see PApplet#color(float, float, float, float)
1598 */
1599 static public int blendColor(int c1, int c2, int mode) { // ignore
1600 return switch (mode) {
1601 case REPLACE -> c2;
1602 case BLEND -> blend_blend(c1, c2);
1603 case ADD -> blend_add_pin(c1, c2);
1604 case SUBTRACT -> blend_sub_pin(c1, c2);
1605 case LIGHTEST -> blend_lightest(c1, c2);
1606 case DARKEST -> blend_darkest(c1, c2);
1607 case DIFFERENCE -> blend_difference(c1, c2);
1608 case EXCLUSION -> blend_exclusion(c1, c2);
1609 case MULTIPLY -> blend_multiply(c1, c2);
1610 case SCREEN -> blend_screen(c1, c2);
1611 case HARD_LIGHT -> blend_hard_light(c1, c2);
1612 case SOFT_LIGHT -> blend_soft_light(c1, c2);
1613 case OVERLAY -> blend_overlay(c1, c2);
1614 case DODGE -> blend_dodge(c1, c2);
1615 case BURN -> blend_burn(c1, c2);
1616 default -> 0;
1617 };
1618 }
1619
1620
1621 public void blend(int sx, int sy, int sw, int sh,

Callers 1

blendColorMethod · 0.95

Calls 14

blend_blendMethod · 0.95
blend_add_pinMethod · 0.95
blend_sub_pinMethod · 0.95
blend_lightestMethod · 0.95
blend_darkestMethod · 0.95
blend_differenceMethod · 0.95
blend_exclusionMethod · 0.95
blend_multiplyMethod · 0.95
blend_screenMethod · 0.95
blend_hard_lightMethod · 0.95
blend_soft_lightMethod · 0.95
blend_overlayMethod · 0.95

Tested by

no test coverage detected