Add new braille character table and color schemes #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When looking at hexdumps, I frequently find myself wishing for easier ways to distinguish between the different bytes that are just specified as
.
in a normal hexdump. I previously experimented with using the Unicode Braille characters for that. When I tried hexyl, I was immediately captured by the idea to add color and thought that color gradients would also add ways to distinguish between different bytes. I thought an image would say more than a thousand words, so I just went ahead and implemented this instead of opening an issue first. I hope this is fine for you.Without further ado, here is what all bytes would look like with the
--character-table braille --color-scheme gradient
options after this PR is merged:I made several design decisions when implementing this:
0x7f
should not be in the same class as the other ASCII-non-printable characters as it has a very different numerical value. Picking this color was difficult, since it had to somehow fit into the general region but still be different enough so as not to be easily confusable.0x00
,\t
,\n
and\r
are not really printable charaters, but still important enough to have their own symbols.Here are some further examples to hopefully showcase how this can help pattern recognition:
UTF8:

UTF16LE with BOM:

Randomness:

$MFT entry:

hexyl binary (start):

Unresolved question: How should this interact with the
--print-color-table
option? Currently this option ignores the color scheme. One option would be to show a smaller variant of the gradients with just 3-4 colors there.Let me if you think anything should be adjusted.
EDIT: Added different character for tabs and changed 0x7f color.