color_to_ansi16 Function

public pure function color_to_ansi16(r, g, b) result(code)

Map an RGB triple to a standard (30-37) or bright (90-97) SGR foreground code by nearest 3-bit color plus a luminance-based bright bit.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: r
real(kind=wp), intent(in) :: g
real(kind=wp), intent(in) :: b

Return Value integer