getColorForByte method

Color getColorForByte(
  1. int byte
)

Returns the appropriate color for a specific byte value.

Uses the byte value to determine which color category it falls into:

Example:

final scheme = ByteColorScheme.standard();
final color = scheme.getColorForByte(0x41); // Returns printableAscii (for 'A')

Implementation

Color getColorForByte(int byte) {
  if (byte == 0x00) return nullByte;
  if (byte >= 0x20 && byte <= 0x7E) return printableAscii;
  if (byte >= 0x01 && byte <= 0x1F) return controlChar;
  return extendedAscii;
}