-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
It would be helpful to invert only the brightness while retaining the hue and saturation of a color. Is this possible? There is currently DynamicColor.invert
. Would it be useful to add a DynamicColor.invertBrightness
?
I tried with the following code, and I get inconsistent results (for example, light-medium orange becomes almost black instead of dark orange). Mostly I'm finding the resulting colors are darker then I would expect.
let hue = hueComponent
let saturation = saturationComponent
let brightness = 1 - brightnessComponent
let alpha = alphaComponent
return DynamicColor(hue:hue, saturation:saturation, brightness:brightness, alpha:alpha)
Metadata
Metadata
Assignees
Labels
No labels