Colour Perception and Sorting

This is yet another story about AMP (my ever-evolving music player) being updated. This one, however, has a subtle twist that most of you probably won’t care about, let alone make use of.

It’s all to do with colour. In all my software, I try to use just four colours in a consistent way: (1) Terminal Default Foreground; (2) Bright Red; (3) Bright Yellow; and (4) Bright Blue. The terminal default will depend on what colour scheme you’ve configured your terminal to use. Commonly, as in the screenshot on the left, it’s bright green for me and my desktops. It’s used to display fairly ‘static informational’ text: things like the program name, the data labels and so on. Bright Red is used to display error or out-of-condition messages or alerts to program behaviours. Bright yellow is used to display user-input or fairly static information derived from user input (such as the folder path/name from which you’re currently playing music). Finally, Bright Blue is used to display fairly dynamic text derived from user input (the name of the database you’re using, for example, or any override switches you’ve specified that affects what music will be selected for play). I may not always be entirely consistent with the way I use my colours, but that’s the general scheme I try to use and stick to, anyway!

Unless you’re colour-blind, in which case, Lord alone knows what you will perceive the colour of any given piece of displayed text to be, if you can see it at all!

As it happens, I have my own colour-perception problems: if something is in C major, I see it (and feel it) as dark blue; in A major, it’s bright yellow; in G major, it’s a sort-of rusty red. It’s all a bit weird, frankly! Anyway, I also know that there are people out there who are more ‘conventionally’ colour-blind, in which case coding things to display in red and green, or blue and green, is probably less than helpful! So, I’ve added a new run-time switch to AMP (which bumps to version 1.17 in consequence): ––colour-light. For our American cousins, it can also be supplied as ––color-light, but really: Noah Webster should have been drowned at birth! Anyway, if that switch appears on the command line, anywhere, however it’s spelled, then the program display will be as you see it in the linked thumbnail: the green comes from whatever your choice of terminal colour scheme deems to be ‘normal’; everything else will appear as ‘white’.

There’s an additional option for those occasions where you prefer a light-themed terminal and thus displaying everything in white-on-light would not make best sense! For fans of light-coloured terminals, there is thus an equivalent new switch: ––colour-dark (which also comes in the American variant ––color-dark). If you use this dark-themed variant, all text will appear in black, not white. Something like this, then:

Finally, there’s the ––colour-neutral option (and it’s American cousin ––color-neutral), which basically makes things look like this:

…where all text will appear in bright yellow, unless it’s normal, static text provided by the program -in which case, it will appear in whatever colour ‘normal’ is defined by your terminal theme (in the above case, it would seem that ‘white’ is normal).

You may need to experiment with your terminal colour and profile appearance settings to get the desired effect, but at least you have a little more control over the appearance of things than you had before. If it’s not sufficiently flexible, you can email me and request some specific outcome and if I can make it happen, I certainly will do my best to do so. Obviously, by reducing the colour palette in these ways, you remove the ‘subtlety’ of the classes of information I alluded to at the start. No longer will you be prompted to spot the difference between mostly-static v. dynamically-derived information. But I figure it is probably better that all the program text is basically legible rather than that, in trying to convey subtlety, it becomes invisible to some people.

If you don’t have any colour perception issues, feel free to ignore the new switches: everything will simply continue to display in green, yellow, red and blue as necessary! A similar colour-changing capability has been added to all my other software scripts, too, and they’ve all incremented upwards in the version number stakes in consequence. Fresh updates for all of them are, of course, available from the usual software download page, so make sure you pick up the new capability whenever you can!

Even if you don’t have colour perception problems, you may also want the new upgrades, however, since there are a couple of bug fixes and display enhancements in most programs. Sticking purely to AMP-related news, for example, there is a new twist on the reporting capability AMP has had, almost since the first day it was written: you can now specify the number of days’ data to fetch and display. In my case, for example, if I simply say:

amp --report --dbname=main

…I will see this sort of response:

PLAYTIME           ARTIST                               ALBUM                                                                             GENRE                   DURATION 
-----------------  -----------------------------------  --------------------------------------------------------------------------------  ----------------------

Continue Reading