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)
| 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, |
no test coverage detected