AnsiColorMode
in package
Tags
Table of Contents
Cases
Methods
- convertFromHexToAnsiColorCode() : string
- Converts an RGB hexadecimal color to the corresponding Ansi code.
- convertFromRGB() : int
- degradeHexColorToAnsi4() : int
- degradeHexColorToAnsi8() : int
- Inspired from https://github.com/ajalt/colormath/blob/e464e0da1b014976736cf97250063248fc77b8e7/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Ansi256.kt code (MIT license).
Cases
Ansi4
Ansi8
Ansi24
Methods
convertFromHexToAnsiColorCode()
Converts an RGB hexadecimal color to the corresponding Ansi code.
public
convertFromHexToAnsiColorCode(string $hexColor) : string
Parameters
- $hexColor : string
Return values
stringconvertFromRGB()
private
convertFromRGB(int $r, int $g, int $b) : int
Parameters
- $r : int
- $g : int
- $b : int
Return values
intdegradeHexColorToAnsi4()
private
degradeHexColorToAnsi4(int $r, int $g, int $b) : int
Parameters
- $r : int
- $g : int
- $b : int
Return values
intdegradeHexColorToAnsi8()
Inspired from https://github.com/ajalt/colormath/blob/e464e0da1b014976736cf97250063248fc77b8e7/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Ansi256.kt code (MIT license).
private
degradeHexColorToAnsi8(int $r, int $g, int $b) : int
Parameters
- $r : int
- $g : int
- $b : int