From 17cfb62ab370c1e8fbbc43bfc126d72a1bd71345 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sun, 31 Jul 2022 17:00:10 -0500 Subject: [PATCH] rename --- src/pixie/common.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pixie/common.nim b/src/pixie/common.nim index b8da007..3e4bc40 100644 --- a/src/pixie/common.nim +++ b/src/pixie/common.nim @@ -76,17 +76,17 @@ proc `*`*(color: ColorRGBX, opacity: float32): ColorRGBX {.raises: [].} = a = ((color.a * x + 127) div 255).uint8 rgbx(r, g, b, a) -proc `*`*(rgbx: ColorRGBX, coverage: uint8): ColorRGBX {.inline.} = - if coverage == 0: +proc `*`*(rgbx: ColorRGBX, opacity: uint8): ColorRGBX {.inline.} = + if opacity == 0: discard - elif coverage == 255: + elif opacity == 255: result = rgbx else: result = rgbx( - ((rgbx.r.uint32 * coverage + 127) div 255).uint8, - ((rgbx.g.uint32 * coverage + 127) div 255).uint8, - ((rgbx.b.uint32 * coverage + 127) div 255).uint8, - ((rgbx.a.uint32 * coverage + 127) div 255).uint8 + ((rgbx.r.uint32 * opacity + 127) div 255).uint8, + ((rgbx.g.uint32 * opacity + 127) div 255).uint8, + ((rgbx.b.uint32 * opacity + 127) div 255).uint8, + ((rgbx.a.uint32 * opacity + 127) div 255).uint8 ) proc snapToPixels*(rect: Rect): Rect {.raises: [].} =