Enum ContrastInvert
- Namespace
- Egami.Operations
- Assembly
- Egami.dll
How HighContrast(bool, ContrastInvert, float) inverts, as Skia's high-contrast filter does.
public enum ContrastInvert
Fields
Brightness = 1Each of red, green and blue becomes 1 − value, which also turns hues around.
Lightness = 2HSL lightness becomes 1 − lightness and hue and saturation stay, so dark text on light becomes light on dark in the same colors.
None = 0No inversion. The default.
Examples
// A two-color poster, then a check of how it reads to someone with deuteranopia.
raster.Apply(o => o.Duotone(Rgba8.FromHex("#1b2a49"), Rgba8.FromHex("#f2c14e")).Posterize(4, DitherMode.Ordered), Ct);
using Raster<Rgba8> preview = raster.Derive(o => o.SimulateColorBlindness(ColorVisionDeficiency.Deuteranopia), Ct);
// High contrast for low vision: gray, lightness inverted so dark becomes light, and more contrast.
using Raster<Rgba8> readable = raster.Derive(o => o.HighContrast(grayscale: true, ContrastInvert.Lightness, contrast: 0.3f), Ct);