← Back to context

Comment by dspillett

1 day ago

Everything should try do some basic syntax highlighting IMO. Not too much, or it just becomes a sea of formatting that doesn't help at all. It is surprising how much difference just a little splash of colour can make if it isn't overdone. If possible, always include configuration options for the user though, so those with colour-blindness issues can tweak things to their needs, those who are just fussy can make the output fit with their finely adjusted system-wide colour schemes¹, and even better, where you can, allow bold/italic/other as well as colours so that those who barely see colour at all can play too.

Of course none of this helps those using screen-readers and other tech, so make sure that all your fancy colouring & such is additive so if it is all “lost” no meaning is absolutely lost with it.

--------

[1] Some people can be very vocal about this, more so than if highlighting isn't possible at all. If you give any output formatting they'll expect you to match, or be able to be made to match, their preferred style.

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read.

They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

  • 8% of the male population has some form of colorblindness (for women it’s around 0.5%). I have deuteranomaly colorblindness. If you search for images on the internet related to that type of colorblindness you’ll find representations of how we see color and how we see the world.

    It is not a fun condition to have, and leads to lots of problems in my everyday life. This blog post accidentally accentuated that issue, since the colors are (to what I can understand) very similar looking to me as a colorblind person.

    1 in 12 men and 1 in 200 women go through the same sorts of experiences, and it’s worth it, if you aren’t color deficient, to try out some of the colorblindness sites and see the world as we do.

    https://www.colourblindawareness.org/colour-blindness/colour...

    • > 1 in 12 men and 1 in 200 women go through the same sorts of experiences,

      Almost everyone to an extent loses some colour definition in their vision as we age, even those lucky enough to have excellent colour vision to start with, some lose a lot more than others and it is gradual so mostly not noticed at first. The is one of the reasons many grandparents have the saturation oddly high on their TVs (the other main reason, of course, being they've just never changed it from the default that is picked to make the display “pop” under bright show-room lighting conditions).

    • Thank you both for sharing your lived experience as well as concrete examples for understanding. I, like I am sure many others, live a richer life knowing what others are going through and how I can make tiny adjustments, even if it's just awareness, to account for how others different from in one way or another go through life.

    • Most color blind men are mildly color blind, plenty even go through their lives without noticing.

      Yours is on the much stronger side of the things.

      2 replies →

    • >1 in 12 men and 1 in 200 women go through the same sorts of experiences, and it’s worth it, if you aren’t color

      Not the same, it's a gradient.

      4 replies →

  • Ubisoft release some tools to simulate colorblindness. It's easy to extract de color transformation from their shader directly. I'm not colorblind but I use that quite often to check roughly if the color palette I choose is fine https://github.com/ubisoft/Chroma

  • > I'd recommend for every developer to get one or more colourblind friends.

    In the absence of any naturally occuring colour-blind friends, do you have any tips about surrptitious damaging someone's eyes to create one? :-)

    Though there are simulation tools avaliable which do a reasonable job, I'll probably stick to those where I have a concern. That feels less drastic.

  • > They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

    Why would you do that?

    • It's obviously a typo (or an excellently delivered joke) but I did get a chuckle out of the idea of someone going out of their way to ask color blind friends for feedback just to do the opposite out of spite for some reason.

      1 reply →

  • Pro-tip: there are browser extensions able to simulate various kinds of color blindness.

    That is better then a random friend, because a.) there are various kinds of colorblindness b.) you wont ask the random friend to work for your company for free.

    • On the other hand, the random friend generally has a great deal of experience with what interventions help and don't help.

      A filter shader generally won't tell you that substituting white for green in a red/green indicator is a great option, or that a colour that they can “see” is still ambiguous when you have to describe it: “I'm clicking the purple button, but it's not doing anything” “Purple? There's no purple in the app!”

  • Get more than one, someone with red-green and blue-yellow color blindness are going to have completely different experiences

  • For sure, but if you don't have any friends, don't discount the value of using tools such as CoBlis:

    https://www.color-blindness.com/coblis-color-blindness-simul...

    .. to get an idea of the impact of your UI design on color-limited folks out there ..

    I used this a few times to great effect, it was very revealing to see that my carefully selected teals and ambers were incomprehensible to some folks I really wanted to use my apps .. didn't take much iteration to come to a happy palette though, just needed a bit of care.

If it isn't possible to turn any syntax highlighting an the like off, I will personally look for alternatives.

Not reconfigure individual settings, turn off syntax highlighting all together.

It's not about style for me, it's about readability.

A screen reader could use various aural means of emphasis that I bet would be as effective as this "color by pattern" idea is.

We have pitch, volume, enunciation speed, and for the voice itself the vocal formant frequency can change as can the harmonics. And that is a rich field we are good at differentiating in too.

One other screen reader idea I had upon seeing this is to use a brief sound either immediately before or after, maybe even slightly overlapping the vocalization.

30 [30 MS BEEP] CO [30 MS BEEP FOLLOWED BY A SHORT CHIRP THAT INDICATES A KNOWN ADDRESS]

Writing that out looks messy. All I can say is the sounds in my head right now make a lot more sense and would compliment the colors nicely.

As long as you just give people list of settings for colors, they can pick as much color or monochrome as they want.

So by all means "color everything", people have different opinions on what they want colored so give them option

> Everything should try do some basic syntax highlighting IMO.

Interesting idea. So even syntax–highlighting natural language. Grammar highlighting, as it were. Prepositions, verbs, question marks, etc. An LLM could do it. Would it actually improve readability though? Seems likely!

  • > So even syntax–highlighting natural language. Grammar highlighting, as it were.

    Not as fine-grained as individual items of grammar, but we essentially already do this and have for almost as long as writing has been a thing. Headings in bold, things that you want to emphasise in body text in italic or bold, hyperlinks underlined and/or in a different colour, …

    Highlighting by grammar might be useful in language analysers/translators, for those of us trying to learn a second, though being able to pick from a selection of rules would be needed for it to be truly useful: sometimes I might want words agreeing with each other (subject->verb, subject->adjectives) in a colour of their own, sometimes specific word types (is abierto the past participle of abrir here, or the adjective?). Or verb tenses. You could perhaps do both tense and agreement, highlighting the stem by tense and the suffix with the same colour as the subject, and object pronouns the same colour as any relevant adjectives, but this is likely to make the colouring system too complex to be useful at a glance. On anything more than a single simple sentence something more dynamic might be better here, not highlighting anything by default but when something is hovered over have it and relevant things spring into colour appropriately, you'll only need small set of colours in that case rather than one for each subject/object in a longer paragraph with trying to match the same subject/object to a set colour consistently throughout.

  • I always enjoy to find people who think so drastically differently than myself. This sounds like an absolute nightmare to me and I would gauge my eyes out.

    • Imo there would be ways to do it so that it could have a similar effect to the capitalized nouns in German

    • Everything in nature is colored. Our eyes are worse than dinosaur eyes but they can still distinguish millions of colors. We might as well use 5-10-20 for highlights.