Minor bug: Custom colours appear black, but they're actually grey
From: Harvey R.
Country: UK
Sent: 21/01/2021
Subject: Custom colours appear black, but they're actually grey
Question:
Hello,
Not really a bug. Extremely harmless too (but it can be confusing).
A user and I were having trouble getting the template to be black when choosing one of the black custom colours that come with SuperMemo. We later realised that although they appear to be black, in reality, they're really not. Have a look at the screenshot below. Selecting one of those custom colours shows that the Template X background turns black, but then when you switch to a different element (e.g., Alt+left) and then return back to the element which was using Template X, the colour becomes light grey.
This is happening in SuperMemo 18.05
Hints
if the element looks different upon return, it is a bug. in the past, some attributes would not be saved without editing the content of the element. Perhaps this is the same problem?
Reply from Harvey
The element does look different upon return, whether you edit the content or not. It also happens in the Templates registry. Here are the steps to see it in action:
- Open Templates registry
- Right click on an empty space of a template and select colour
- Choose any of the original (black) custom colours and press OK (the color box should have a black background, not a chosen custom color)
- Flick to another template and return to the one you just changed
- The colour of it should now be light grey instead of black
Try the steps above in the main menu and you will get the same result (whether you edit the content or not).
Technical
After 20 minutes of trying this was reproduced. It is hard to say what code is passed from the color dialog when the custom color is not defined, but to get into this trouble, one would need to go against the design of the color dialog (implemented in Windows, encapsulated in the VCL library). The good news is that all functions around template color choosing work as expected despite having some b ug reports for past versions
Answer: