Feature Request -- Rinv, Ginv, Binv, GiRB & BiRG
Feature Request -- Rinv, Ginv, Binv, GiRB & BiRG
Description of the feature
Single step to shift RGB color color channels left from BRG to RGB to GBR or right from GRB to RGB to BRG, or to toggle the R G or B values between one's complements or two's complements of themselves.
Add screenshots, design images or other files which would help for understanding the feature or for implementation. Also add links when needed, for instance for implementation standards or other relevant resources.
Use cases
I have noticed that the color pallet has a small number of memory slots and quickly runs out of space. This would effectively make each storage slot effectively hold six colors, except in certain cases which I will explain later.
This would work by shifting digits left or right by one digit in each of the stored RGB color values.
For example. clicking GiRB twice would change "green into red", hence the "GiR" in the name, by shifting the hexadecimal digits one position left per click.
That is, the value 00FF00, representing the stored pure green color, would be changed by the first click on the GiRB button to 0FF000, which is not quite pure green but still close to it, and then that value would be changed on the next click of the GiRB button to FF0000, representing a stored pure red color. If you were to then click on the GiRB button again, it would change that value into F0000F, which is not quite pure red but pretty close to it, and then the next click of the GiRB button would change it to 0000FF, representing a stored pure blue color.
For example. clicking GiRB twice would change "green into red", hence the "GiR" in the name, by shifting the hexadecimal digits one position left per click.
Likewise, the value 0000FF, representing the stored pure blue color, would be changed by the first click on the BiRG button to F0000F, which is almost pure red but not quite, and then that value would be changed on the next click of the BiRG button to FF0000, representing a stored pure red color. If you were to then click on the BiRG button again, it would change that value into 0FF000, which is almost pure green but not quite, and then the next click of the BiRG button would change it to 00FF00, representing a stored pure green color.
Of course, the shift could be done two digits at a time, but that pretty much cuts in half the number of colors each storage space could effectively represent. On the other extreme, the RGB values could simple be shifted one bit left or right with each click, making a total of twelve clicks necessary to cycle back to where you started, but that seems a bit excessive and might be a bit too confusing for some people. I think the single digit shift is a good compromise and if the currently selected color was also shifted when GiRB or BiRG was clicked, then since the hexadecimal RGB value display for the current color would show the shift numerically, it should be more obvious what effect those buttons represent when clicked.
The attached image file shows an example of these effects. Note that the number of colors represented by a single memory slot in this way depends on how redundant the digits are in the RGB color value. Values with all matching digits won't change at all and value with cyclic patterns such as f0f0f0 will not produce the full yield achieved with non-repetitive RGB values.
Also note the Rinv, Ginv, and Binv buttons in the image. While the image does not how examples of their intended effect, the idea there is to have the Rinv button inverse the red value to the one's complement or the two's complement of it's current value, depending on whether the checkbox next to those buttons is set or cleared.
While none of the other color changes mentioned will have much, if any, effect of mid-range shades of grey, such as 7f7f7f or 808080, which are the one's complements of each other, the two's complement change would be quite easily noticeable. For example, clicking Binv while set to two's complement would change 7f7f7f to 7f7fff, which is a light blue, and would change the almost identical grey 808080 into 808000, which is a rather brownish looking dark yellow.
Once the code is written for these simple color changes, it should also not be difficult to add options into the Colors menu, in the same section as "invert", to apply any of them to the current image rather than the color history pallet and currently selected foreground or background color.
DAK