Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"R G B" Values in Hexidecimal Editors are Improperly Arranged in Reverse #1141

Closed
Derpercoaster opened this issue Sep 14, 2022 · 13 comments
Closed

Comments

@Derpercoaster
Copy link

Bug
In settings, the RGB values in hexiecimal color selectors are incorrectly arranged as "B G R" instead of "R G B".

I.E. Red in hexidecimal is #FF0000, but in OpenShell, red is #0000FF, which is incorrectly reversed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Open-Shell settings
  2. Go to any hexidecimal color selector
  3. Enter a valid hexidecimal value (i.e. FF0000 for red, or 0000FF for blue)
  4. The resulting color will seem to be incorrect, as R and B are incorrectly swapped

Expected Behavior
Hexidecimal editors are always arranged as "R G B", and have been since their inception. Apologies if I sound rude, but I have never seen anyone arrange a hexidecimal editor in reverse.

Version:

  • Open-Shell: 4.4.160
  • OS: Windows 10, Version 19044.2006

Other Notes
I wouldn't have posted this if someone else did, but I am unable to find existing reports on this bug. Apologies if this does turn out to be a duplicate report. I am also aware I have an older version, but once again, the above note still holds true.

@CTVCAM8
Copy link

CTVCAM8 commented Sep 14, 2022

This issue is similar to #82 from years back:

It's strange to me as well. Ever since color pickers were added to Classic Shell,
I'd have to mentally rearrange before entering or cut and paste the opposite way, or just use crosshairs and slider.
Surely there must be some bit of math code that can interrupt and switch the values entered
and also what's shown to get around the Microsoft way of doing things.

It's good to bring it up again. New coders might be up for the challenge. :)

@dt192
Copy link

dt192 commented Nov 23, 2022

I just came to report this too, was so confused. Surprising this bug has been open for so long.

@ge0rdi
Copy link
Member

ge0rdi commented Nov 23, 2022

Surprising this bug has been open for so long.

Maybe because it is not a bug?
@CTVCAM8 explains it clearly in #82 (comment).

BGR is also valid color format. It may be a bit inconvenient for somebody that is used to RGB but that doesn't make it a bug.

What we can do is to add hint about color format into tooltip for given color settings.
Would that help?

@dt192
Copy link

dt192 commented Nov 23, 2022

Ah, I didn't see there were more than one bug report open for it.

Two things would help.

  1. Having an eye dropper, so we can just sample color from the screen instead of having to do it elsewhere and paste in the hex colour.
  2. When we do paste a hex colour, have a little pop up with 2 color squares to pick from on it, one showing the RGB swatch and one showing the reversed version, so we just click the one we wanted.

I'm not convinced having read that COLORREF page that they are saying you should present them to the user in reverse order. Even their own color picker goes RGB order. This is the first time I've experienced anything presenting them in BGR order. I'm sure there must be a few apps where they are, but RGB is very much the norm.

2022-11-23 19_37_25-Settings

@CTVCAM8
Copy link

CTVCAM8 commented Nov 26, 2022

Just in case a coder decides to totally go all in and adds back & forth translation code for the hex color box,
be aware there's another location that uses BGR. Any modified skins that use "OPTION_COLOR" text from the Metallic.skin7, have a color picker involved.

Skin text for example:

; BLUE SAPPHIRE
OPTION_COLOR CUSTOM_NEW_PROGRAMS_COLOR=Custom new programs color, 0 ,TRUE, 8A6D0D

The Hex #color at the end of the above line has to be in BGR format to display the blue-green color.
If RGB format is used, it will display as BISTRE BROWN.

@ge0rdi
Copy link
Member

ge0rdi commented Nov 27, 2022

Any modified skins that use "OPTION_COLOR" text from the Metallic.skin7, have a color picker involved

It is not only about that skin option.
All colors in skin description have BGR format.

It would be kind of confusing to use multiple color formats in the program.

@ge0rdi
Copy link
Member

ge0rdi commented Nov 27, 2022

For now, I'd add (BBGGRR) hint to the setting text, so that it is clear what format it expects the color to be.
It will look like this:
image

I hope it will make things more clear.

@CTVCAM8
Copy link

CTVCAM8 commented Nov 27, 2022

@ge0rdi

Sorry, I don't understand about [All colors in skin description have BGR format].
I'm sure you are right about the BGR code. Gather Microsofts quirky ways of doing things.

From where I'm looking at it from a skinners point of view.
All areas, (except for 'OPTION_COLOR') in the skin text file use RRGGBB and display on the start menu as RRGGBB.


Ivo added the below info into a number of his skins:

; Caption_text_color - RRGGBB color of the caption text. Defaults to white

; Main_bitmap_mask - a bitmap or a solid color in #RRGGBB format that is used to blend Main_bitmap with the glass color and the menu background color.

; Main_selection_mask - a bitmap or a solid color in #RRGGBB format that is used to blend the selection bitmap with the glass color and the menu background color.


This also applies to text, arrows, tints, Programs_background, etc.

I agree with your "hint" recommendation for the color box.
It looks easy to implement.

@ge0rdi
Copy link
Member

ge0rdi commented Nov 28, 2022

All areas, (except for 'OPTION_COLOR') in the skin text file use RRGGBB and display on the start menu as RRGGBB.

You are right.
I've double checked it now and when skin description is read, we are converting RRGGBB numbers to internal BBGGRR format.
Thank you for pointing this out.

It would make sense to expect RRGGBB also in other color settings.
So that one color format will be used throughout the program consistently.

I'll try to have a look at it eventually.

ge0rdi added a commit to ge0rdi/Open-Shell-Menu that referenced this issue Nov 30, 2022
We are storing color settings in BBGGRR format (for historical reasons).
This may be confusing for people that are used to (more widely used) RRGGBB format.

Thus we will present color settings in RRGGBB format when editing.

We will still use BBGGRR format for those settings internally. To
maintain backward compatibility with existing settings stored in
registry/xml.

Also setting descriptions now contain hint about expected color format.
This way it should be more clear what values `Open-Shell` expects.

Fixes Open-Shell#82, Open-Shell#1141.
@CTVCAM8
Copy link

CTVCAM8 commented Dec 5, 2022

I like the backward compatibility. From the limited amount of testing it,
I love it. Regular users will be happy so they can paste from elsewhere.

@dt192
Copy link

dt192 commented Dec 5, 2022

Awesome, thanks ge0rdi. When would be expecting this in release roughly?

@ge0rdi
Copy link
Member

ge0rdi commented Dec 6, 2022

I hope it will be soon.
I'm currently testing more changes (this one among them).

ge0rdi added a commit that referenced this issue Dec 6, 2022
We are storing color settings in BBGGRR format (for historical reasons).
This may be confusing for people that are used to (more widely used) RRGGBB format.

Thus we will present color settings in RRGGBB format when editing.

We will still use BBGGRR format for those settings internally. To
maintain backward compatibility with existing settings stored in
registry/xml.

Also setting descriptions now contain hint about expected color format.
This way it should be more clear what values `Open-Shell` expects.

Fixes #82, #1141.
@ge0rdi
Copy link
Member

ge0rdi commented Dec 6, 2022

Fixed in 4.4.181.

@ge0rdi ge0rdi closed this as completed Dec 6, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants