Types
FixedPalette = ref object colors: seq[ColorRGBX]
- A palette made of explicit colors
Consts
BlackAndWhiteIntPalette = ()
- A palette that uses integers to represent shades of gray, but the output palette is only black and white
Procs
proc `+`(color: ColorRGBX; scalar: int): ColorRGBX {....raises: [], tags: [].}
- Add a scalar value to a color
proc approxMaxColorDistance(palette: BlackAndWhiteIntPaletteObj): int {. ...raises: [], tags: [].}
- Returns the maximum distance between colors
proc approxMaxColorDistance(palette: FixedPalette): int {....raises: [], tags: [].}
- Returns an estimate for the maximum distance between colors
proc nearestColor(palette: BlackAndWhiteIntPaletteObj; color: int): int {. ...raises: [], tags: [].}
- Returns black or white, whichever is closest
proc nearestColor(palette: FixedPalette; color: ColorRGBX): ColorRGBX {. ...raises: [], tags: [].}
- Returns the nearest color that's in a given palette
proc palette(colors: varargs[ColorRGBX]): FixedPalette {....raises: [], tags: [].}
- Creates a palette from the given set of colors