Documentation

AnsiColorMode
in package

Tags
author

Fabien Potencier fabien@symfony.com

author

Julien Boudry julien@condorcet.vote

Table of Contents

Cases

Ansi24
Ansi4
Ansi8

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

Methods

convertFromHexToAnsiColorCode()

Converts an RGB hexadecimal color to the corresponding Ansi code.

public convertFromHexToAnsiColorCode(string $hexColor) : string
Parameters
$hexColor : string
Return values
string

convertFromRGB()

private convertFromRGB(int $r, int $g, int $b) : int
Parameters
$r : int
$g : int
$b : int
Return values
int

degradeHexColorToAnsi4()

private degradeHexColorToAnsi4(int $r, int $g, int $b) : int
Parameters
$r : int
$g : int
$b : int
Return values
int

degradeHexColorToAnsi8()

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
Return values
int

        
On this page

Search results