An image that consists of indexes into a color palette. Use getAsTrueColorImage if you don't care about palettes
An RGBA array of image data. Use the free function quantize() to convert to an IndexedImage
Perform alpha-blending of fore to this color, return new color. WARNING! This function does blending in RGB space, and RGB space is not linear!
.
the opposite of moderate. Make darks darker and lights lighter
Finds the best match for pixel in palette (currently by checking for minimum euclidean distance in rgb colorspace)
Implements a flood fill algorithm, like the bucket tool in MS Paint.
Dithers img in place to look more like original.
Converts hsl to rgb
Converts hsl to rgb
OKLab colorspace conversions to/from Color. See: https://bottosson.github.io/posts/oklab/
.
Calculates the linear offset of a point from the start (0/0) of a rectangle.
Try to determine a text color - either white or black - based on the input
for light colors, call darken. for dark colors, call lighten. The goal: get toward center grey.
Move around the lightness wheel, trying not to break on moderate things
Converts true color to an indexed image. It uses palette as the starting point, adding entries until maxColors as needed. If palette is null, it creates a whole new palette.
Assumes the input u is already between 0 and 1 fyi.
Converts an RGB color into an HSL triplet. useWeightedLightness will try to get a better value for luminosity for the human eye, which is more sensitive to green than red and more to red than blue. If it is false, it just does average of the rgb.
OKLab colorspace conversions to/from Color. See: https://bottosson.github.io/posts/oklab/
This provides two image classes and a bunch of functions that work on them.
A type to represent an angle, taking away ambiguity of if it wants degrees or radians.
Represents an RGBA color
Represents an RGBA color in floating-point (from 0 to 1.0).
OKLab colorspace conversions to/from Color. See: https://bottosson.github.io/posts/oklab/
2D location point
Base module for working with colors and in-memory image pixmaps.
Also has various basic data type definitions that are generally useful with images like Point, Size, and Rectangle.