|
💻 TermColor User Manual
|

Classes | |
| struct | ColoredChar |
Public Member Functions | |
| DitherMapping (IEnumerable< KeyValuePair< char, float >> configuration) | |
| ColoredChar | Map (in ColorRGB color) |
| void | Precompute (int resolution=6) |
Static Public Attributes | |
| static readonly DitherMapping | Default |
Package Functions | |
| ColorRGB | Mix (ColorRGB foreground, ColorRGB background, char mask) |
| ColoredChar | FindClosest (in ColorRGB color) |
Properties | |
| IReadOnlyDictionary< char, float > | MaskOpacity [get] |
| bool | IsComputed [get] |
| int? | Resolution [get] |
Represents a dithering character set with precomputed palette.
This class can find closest approximation of a given color by mixing different colors and masking characters. It precomputes this approximation to a certain level of detail (see Precompute(int)) and can later find color aproximations (see Map(in ColorRGB)).
|
inline |
Create a dithering character set.
| configuration | List of dithering characters with their respective opacities. See Default for an example value. |
|
inlinepackage |
Search the entire color space and find the closest approximation of color .
| color |
|
inline |
Find best approximation of color using the precomputed data.
| InvalidOperationException | Thrown when not precomputed. |
| color | The color to approximate |
|
inlinepackage |
Mix two colors using the specified character.
| foreground | Foreground color. |
| background | Background color. |
| mask | The mask character. |
|
inline |
Precompute the color mapping approximation.
| resolution |
|
static |
The default dithering preset with the following configuration:
{ new ( ' ', 0 / 4f ), new ( 'â–‘', 1 / 4f ), new ( 'â–’', 2 / 4f ), new ( 'â–“', 3 / 4f ) }
|
get |
True if the preset has already been precomputed.
|
get |
Configuration of this preset. List of dithering characters with their respective opacities.
|
get |
Resolution of the approximation.