fromValue static method

GhosttySgrAttributeTag fromValue(
  1. int value
)

Implementation

static GhosttySgrAttributeTag fromValue(int value) => switch (value) {
  0 => GHOSTTY_SGR_ATTR_UNSET,
  1 => GHOSTTY_SGR_ATTR_UNKNOWN,
  2 => GHOSTTY_SGR_ATTR_BOLD,
  3 => GHOSTTY_SGR_ATTR_RESET_BOLD,
  4 => GHOSTTY_SGR_ATTR_ITALIC,
  5 => GHOSTTY_SGR_ATTR_RESET_ITALIC,
  6 => GHOSTTY_SGR_ATTR_FAINT,
  7 => GHOSTTY_SGR_ATTR_UNDERLINE,
  8 => GHOSTTY_SGR_ATTR_UNDERLINE_COLOR,
  9 => GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256,
  10 => GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR,
  11 => GHOSTTY_SGR_ATTR_OVERLINE,
  12 => GHOSTTY_SGR_ATTR_RESET_OVERLINE,
  13 => GHOSTTY_SGR_ATTR_BLINK,
  14 => GHOSTTY_SGR_ATTR_RESET_BLINK,
  15 => GHOSTTY_SGR_ATTR_INVERSE,
  16 => GHOSTTY_SGR_ATTR_RESET_INVERSE,
  17 => GHOSTTY_SGR_ATTR_INVISIBLE,
  18 => GHOSTTY_SGR_ATTR_RESET_INVISIBLE,
  19 => GHOSTTY_SGR_ATTR_STRIKETHROUGH,
  20 => GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH,
  21 => GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG,
  22 => GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG,
  23 => GHOSTTY_SGR_ATTR_BG_8,
  24 => GHOSTTY_SGR_ATTR_FG_8,
  25 => GHOSTTY_SGR_ATTR_RESET_FG,
  26 => GHOSTTY_SGR_ATTR_RESET_BG,
  27 => GHOSTTY_SGR_ATTR_BRIGHT_BG_8,
  28 => GHOSTTY_SGR_ATTR_BRIGHT_FG_8,
  29 => GHOSTTY_SGR_ATTR_BG_256,
  30 => GHOSTTY_SGR_ATTR_FG_256,
  _ => throw ArgumentError(
    'Unknown value for GhosttySgrAttributeTag: $value',
  ),
};