faq:why-is-my-color-different

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
faq:why-is-my-color-different [2016/09/05 17:04] – [Example] adminfaq:why-is-my-color-different [2018/04/13 14:39] (current) admin
Line 2: Line 2:
 HippoEDIT style color configuration is VERY flexible but in same time not easy predictable :) HippoEDIT style color configuration is VERY flexible but in same time not easy predictable :)
  
-Because of that, "question" like"WTF? Why the color is not like I have defined!??" comes rather often. It is not easy to answer what is the reason of the problem in every concrete case, but below you can find list of possible reasons that can influence the end color, used by editor to draw styles: +Because of that, "question" like "WTF? Why the color is not like I have defined!??" comes rather often. It is not easy to answer what is the reason of the problem in every concrete case, but below you can find list of possible reasons that can influence the end color, used by the editor to draw styles: 
-  - **Style inheritance**. Some syntax styles are inherited from parent syntaxes. The inheritance is indicated in round brackets aside to style name in [[options:syntax:font_and_colors|Font & Colors configuration dialog]]. In this way, if you change the style configuration in child syntax, the change will result in not only current syntax but parent syntax and all other syntaxes inheriting from parent (owning) syntax. From another side, if you change style settings in parent syntax (in //Default//, for example), it does not mean, that the change will reflect in all syntaxes because some of the inheriting syntaxes may overwrite the style configuration. You may only notice that by checking leaf/end syntax.  +  - **Style inheritance**. Some syntax styles are inherited from parent syntaxes. The inheritance is indicated in round brackets aside to style name in [[options:syntax:font_and_colors|Font & Colors configuration dialog]]. In this way, if you change the style configuration in child syntax, the change will result in not only current syntax but parent syntax and all other syntaxes inheriting from the parent (owning) syntax. From another side, if you change style settings in parent syntax (in //Default//, for example), it does not mean, that the change will reflect in all syntaxes because some of the inheriting syntaxes may overwrite the style configuration. You may only notice that by checking leaf/end syntax.  
-  - **Style layering/stapling**. When drawing, HippoEDIT does not use single style but applies all matching styles one on top of other, [[faq:syntax-highlighting-style-priorities|following defined style priorities]]. Window style + text style + line style + selection style etc. The layering applies to colors and styles. If a color has defined transparency (alpha > 0%), the resulting color will be a mixure of bottom style color and top style color. If alpha is 0, resulting color is equal to top color. The layering is applied for background and foreground colors separately. Because of such dynamic layering, the result is highly dependent from the documentand may differ depending on how many styles were applied. +  - **Style layering/stapling**. When drawing, HippoEDIT does not use single style but applies all matching styles one on top of other, [[faq:syntax-highlighting-style-priorities|following defined style priorities]]. Window style + text style + line style + selection style etc. The layering applies to colors and styles. If a color has defined transparency (alpha > 0%), the resulting color will be a mixture of bottom style color and top style color. If alpha is 0, resulting color is equal to top color. The layering is applied to background and foreground colors separately. Because of such dynamic layering, the result is highly dependent on the document and may differ depending on how many styles were applied. 
-  - On top of everything, the editor will apply [[options:color-scheme#contrast|contrast ratio]] rules, on final text and background color, and will modify a text color (foreground color) in a way that minimal contrast ratio is ensured. +  - On top of everything, the editor will apply **[[options:color-scheme#contrast|contrast ratio]]** rules, on final text and background color, and will modify a text color (foreground color) in a way that minimal contrast ratio is ensured. 
  
 ===== Example ===== ===== Example =====
 Why is color different from defined on example below? Why is color different from defined on example below?
-  - //Sample// preview in configuration dialog tries to predict possible layering and show you the final result of it. It will take window style and apply current style on top, merging colors for background and foreground. The sample shows text color which different that one sees in the color drop down. Why?\\ {{:faq:color_configuration.png?200|Color configuration}} +  - //Sample// preview in configuration dialog tries to predict possible layering and show you the final result of it. It will take window style and apply current style on top, merging colors for background and foreground and considering defined contrast ratio. The sample shows text color which different that one sees in the color drop down. Why?\\ {{:faq:color_configuration.png?500|Color configuration}} 
-  - "Highlight 4- is referencing color, from current palette.\\ {{:faq:color_configuration_2.png?200|Palette Color}}+  - //Highlight 4// - is referencing color, from current palette.\\ {{:faq:color_configuration_2.png?500|Palette Color}}\\ The color has defined 50% of transparency and resulting color will be a mix of window text color and //Highlight 4// color.  
 +  - But if we change style color to explicit one, without transparency, the color is still not like we have defined!\\ {{:faq:color_configuration_3.png?500|Explicit color definition}} 
 +  - Let us check then [[options:color-scheme|Contrast Ratio]] for current scheme, and change it from default //Normal (5:1)// to //Do not Change//. 
 +  - Finally, we got the desired result :)\\ {{:faq:color_configuration_4.png?500|Setting contrast ratio}}