- (subtraction) operator

Type Assocation Precedence Input types Output types
binary left 4 int
float
complex
color
int
float
complex
color

This operator subtracts the second operand from the first operand and returns the result. The type of the result is equal to the largest type of the operands (complex is larger than float, and float is larger than int).

When used with color operands, the - operator returns a color where each component (red, green, blue, alpha) is the signed difference of the respective components from the operands.

Examples:

3 - 2                      ; 1
3.15 - 9                   ; -5.85
(3, 2) - (6, 4)            ; (-3, -2)
rgba(1, 0.4, 0.2, 1) - \
rgba(0.5, 0.49, 0.1, 1)    ; rgba(0.5, -0.99, 0.1, 0)

See Also
Writing direct coloring algorithms
+ (addition) operator