mirror of
https://github.com/catppuccin/nim.git
synced 2024-11-13 20:47:53 -06:00
fix: remove unused ColorRGBX
This commit is contained in:
parent
f331a2f050
commit
3b1a12d744
1 changed files with 0 additions and 19 deletions
|
@ -28,13 +28,6 @@ type
|
||||||
b*: uint8 ## Blue 0-255
|
b*: uint8 ## Blue 0-255
|
||||||
a*: uint8 ## Alpha 0-255
|
a*: uint8 ## Alpha 0-255
|
||||||
|
|
||||||
ColorRGBX* = object
|
|
||||||
## Premultiplied alpha RGBA color stored as 4 uint8s
|
|
||||||
r*: uint8 ## Red 0-a
|
|
||||||
g*: uint8 ## Green 0-a
|
|
||||||
b*: uint8 ## Blue 0-a
|
|
||||||
a*: uint8 ## Alpha 0-255
|
|
||||||
|
|
||||||
# Color Space: HSL
|
# Color Space: HSL
|
||||||
ColorHSL* = object
|
ColorHSL* = object
|
||||||
## HSL attempts to resemble more perceptual color models
|
## HSL attempts to resemble more perceptual color models
|
||||||
|
@ -78,18 +71,6 @@ proc hsl*(h, s, l: float32): ColorHSL {.inline.} =
|
||||||
|
|
||||||
# chroma/transformations ----------
|
# chroma/transformations ----------
|
||||||
|
|
||||||
proc rgba*(c: ColorRGBX): ColorRGBA {.inline.} =
|
|
||||||
## Convert a premultiplied alpha RGBA to a straight alpha RGBA.
|
|
||||||
result.r = c.r
|
|
||||||
result.g = c.g
|
|
||||||
result.b = c.b
|
|
||||||
result.a = c.a
|
|
||||||
if result.a != 0 and result.a != 255:
|
|
||||||
let multiplier = round((255 / c.a.float32) * 255).uint32
|
|
||||||
result.r = ((result.r.uint32 * multiplier + 127) div 255).uint8
|
|
||||||
result.g = ((result.g.uint32 * multiplier + 127) div 255).uint8
|
|
||||||
result.b = ((result.b.uint32 * multiplier + 127) div 255).uint8
|
|
||||||
|
|
||||||
proc rgb*(c: Color): ColorRGB {.inline.} =
|
proc rgb*(c: Color): ColorRGB {.inline.} =
|
||||||
## Convert Color to ColorRGB
|
## Convert Color to ColorRGB
|
||||||
result.r = round(c.r * 255).uint8
|
result.r = round(c.r * 255).uint8
|
||||||
|
|
Loading…
Reference in a new issue