-
Notifications
You must be signed in to change notification settings - Fork 102
CSSTUDIO-3196 Change the semantics of colors defined to be equal to other colors #3376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ther colors: a color defined to be equal to another color is now an alias for the other color.
f79712b
to
af1c2c1
Compare
When I open the color selection dialog, do I still see "OK" and "GREEN" listed in there? For an LED that displays a good/bad state, I want to pick "OK". |
No, and that is the purpose of the pull request: to reduce the number of duplicated colors in the list of colors.
The intended scenario is that the default colors are defined to be "correct" according to a convention defined in a written document. Only seldomly, in rare cases, should the default colors be changed. Suppose that one of those rare cases happens, and the user wants to select a green color. The intent of the pull request is to avoid the situation where there are several (duplicated or different) green colors. A concrete example: Consider the LED widget. Right now, if you don't actively pick a color, the on-state has the color 'On'. When starting Phoebus, there is also the color 'OK' defined. The two colors 'On' and 'OK' may be identical or not. When choosing a green color to signal that something is "on" or "OK", it is not always intuitively clear which color to choose, since it may not be so clear which of the adjectives more accurately describes the status. |
Of course, you are right that if you want two defined colors that are identical, then, with this change, the color would have to be defined twice using the numerical values. In the example in the initial comment, one would have to write:
|
Isn't that a site-specific decision? |
Phoebus does also create colors that are not specified in
I am not sure whether the solution in the pull request is the best way to solve this. However, I think that it would be good to have a way of setting default colors for widgets without creating new colors. |
The problem is that this is not the case: the widgets (through the default colors) and alarm-functionality dictate colors that appear in the list of colors, at the latest after they have been configured in The intention of this pull request is to allow the names of the colors that appear in the list of colors to be site-specific. Perhaps it would be better to introduce a second mechanism for aliasing colors? Currently one can write, e.g, |
@abrahamwolk I do not like the idea of aliasing or automatically trimming the color list...I think this is a problem that is best resolved by maintaining a well defined color.def file. I am happy to discuss a solution for the first ( since I am guilty of creating the alarm level colors which do not show up in the color selection dialogs. ) |
@shroffk I think it would be great to have a meeting to discuss this. I will send you an invitation. |
As long as I can do this...
.. you can do whatever you prefer regarding |
Consider the color definitions
Currently, this will result in Phoebus having the following two colors defined:
The intent of this pull request is to change the semantics so that the color definitions instead results in only the color
being defined, while any reference to the color "OK" is replaced with a reference to the color "GREEN" instead. (I.e., "OK" points to the the color
GREEN
instead of being defined as an identical color.)The motivation for this change is that widgets in Phoebus have hard-coded default colors, and setting them all to default values results in identical colors being defined that differ only in their name. With this change, it is possible to instead "redirect" the default colors to other colors.