Skip to content

face

FACE, Fortran Ansi Colors Environment.

Source: src/lib/face.F90

Dependencies

mermaid
graph LR
  face["face"] --> iso_fortran_env["iso_fortran_env"]

Contents

Variables

NameTypeAttributesDescription
ASCIIintegerparameterASCII character set kind.
UCS4integerparameterUnicode character set kind.
UPPER_ALPHABETcharacter(len=26)parameterUpper case alphabet.
LOWER_ALPHABETcharacter(len=26)parameterLower case alphabet.
NLcharacter(len=1)parameterNew line character.
ESCAPEcharacter(len=1)parameter"" character.
CODE_STARTcharacter(len=2)parameterStart ansi code, "[".
CODE_ENDcharacter(len=1)parameterEnd ansi code, "m".
CODE_CLEARcharacter(len=4)parameterClear all styles, "[0m".
STYLEScharacter(len=17)parameterStyles.
COLORS_FGcharacter(len=15)parameterForeground colors.
COLORS_BGcharacter(len=15)parameterBackground colors.

Interfaces

colorize

Module procedures: colorize_default

Subroutines

colors_samples

Print to standard output all colors samples.

fortran
subroutine colors_samples()

Call graph

mermaid
flowchart TD
  colors_samples["colors_samples"] --> colorize["colorize"]
  style colors_samples fill:#3e63dd,stroke:#99b,stroke-width:2px

styles_samples

Print to standard output all styles samples.

fortran
subroutine styles_samples()

Call graph

mermaid
flowchart TD
  styles_samples["styles_samples"] --> colorize["colorize"]
  style styles_samples fill:#3e63dd,stroke:#99b,stroke-width:2px

Functions

colorize_default

Colorize and stylize strings, DEFAULT kind.

Attributes: pure

Returns: character(len=:)

fortran
function colorize_default(string, color_fg, color_bg, style) result(colorized)

Arguments

NameTypeIntentAttributesDescription
stringcharacter(len=*)inInput string.
color_fgcharacter(len=*)inoptionalForeground color definition.
color_bgcharacter(len=*)inoptionalBackground color definition.
stylecharacter(len=*)inoptionalStyle definition.

Call graph

mermaid
flowchart TD
  colorize_default["colorize_default"] --> color_index["color_index"]
  colorize_default["colorize_default"] --> style_index["style_index"]
  colorize_default["colorize_default"] --> upper["upper"]
  style colorize_default fill:#3e63dd,stroke:#99b,stroke-width:2px

color_index

Return the array-index corresponding to the queried color.

@note Because Foreground and backround colors lists share the same name, no matter what array is used to find the color index. Thus, the foreground array is used.

Attributes: elemental

Returns: integer(kind=int32)

fortran
function color_index(color)

Arguments

NameTypeIntentAttributesDescription
colorcharacter(len=*)inColor definition.

Call graph

mermaid
flowchart TD
  colorize_default["colorize_default"] --> color_index["color_index"]
  style color_index fill:#3e63dd,stroke:#99b,stroke-width:2px

style_index

Return the array-index corresponding to the queried style.

Attributes: elemental

Returns: integer(kind=int32)

fortran
function style_index(style)

Arguments

NameTypeIntentAttributesDescription
stylecharacter(len=*)inStyle definition.

Call graph

mermaid
flowchart TD
  colorize_default["colorize_default"] --> style_index["style_index"]
  style style_index fill:#3e63dd,stroke:#99b,stroke-width:2px

upper

Return a string with all uppercase characters.

Attributes: elemental

Returns: character(len=len)

fortran
function upper(string)

Arguments

NameTypeIntentAttributesDescription
stringcharacter(len=*)inInput string.

Call graph

mermaid
flowchart TD
  colorize_default["colorize_default"] --> upper["upper"]
  style upper fill:#3e63dd,stroke:#99b,stroke-width:2px