The OpenD Programming Language

RGB.opUnary

Unary operators.

struct RGB(string components_, ComponentType_, bool linear_ = false, RGBColorSpace colorSpace_ = RGBColorSpace.sRGB)
@safe pure nothrow @nogc const
typeof(this)
opUnary
(
string op
)
()
if (
op == "+" ||
op == "-"
||
(
op == "~" &&
)
)
if (
isNumeric!ComponentType_
)

Examples

static assert(+UVW8(1,2,3) == UVW8(1,2,3));
static assert(-UVW8(1,2,3) == UVW8(-1,-2,-3));

static assert(~RGB8(1,2,3) == RGB8(0xFE,0xFD,0xFC));
static assert(~UVW8(1,2,3) == UVW8(~1,~2,~3));

Meta