winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Documentation for themes

Open StoyanDimitrov opened this issue 2 years ago • 5 comments

Playing around with themes I'm facing certain difficulties:

  1. how are the colour values converted/calculated from/to HEX colour notation (0x98a12a -> #??????) probably here.
  2. ~~how to map the cryptic Settings/SNPColor to something human friendly.~~

I'm ready to devote some time to make such document but I need to find a way to grasp those things first.


Edit: I think I'm able to figure out the second point after second look at the sources.

StoyanDimitrov avatar Oct 21 '23 12:10 StoyanDimitrov

Assuming that #?????? represents an HTML color.

Since WinMerge uses the Win32API COLORREF type to represent colors, the conversion from HTML color is as follows, with the RGB order reversed:

#rrggbb → 0x00bbggrr Example: #c1d2e3 → 0x00e3d2c1

Changing to your desired color in the Options window and then exporting it to an INI file using the Export button can be helpful.

sdottaka avatar Oct 23 '23 09:10 sdottaka

Do you mind if I turn the info I gathered so far into a short page in the Wiki?

StoyanDimitrov avatar Oct 23 '23 10:10 StoyanDimitrov

thank you! I've unlocked the Wikipages, so I think you can edit it.

sdottaka avatar Oct 23 '23 11:10 sdottaka

Working on a template I stumbled upon those settings that seems to miss a UI for changing them. At least it seems so. Should I include them in the template? Probably the Settings/Image* should be left out but what about others?

DefaultSyntaxColors/Color14
DefaultSyntaxColors/Color15
DefaultSyntaxColors/Color16
DefaultSyntaxColors/Color17
DefaultSyntaxColors/Color18
DefaultSyntaxColors/Color19

Settings/ImageBackColor
Settings/ImageColorDistanceThreshold
Settings/ImageDiffColorAlpha

StoyanDimitrov avatar Nov 14 '23 14:11 StoyanDimitrov

The colors below are related to word difference colors, but are not actually used as Settings/*WordDifference* is used instead. You can include it in the color schema file or not. (included in other color scheme files)

DefaultSyntaxColors/Color14 # COLORINDEX_HIGHLIGHTBKGND1 = Settings/SelectedWordDifferenceColor
DefaultSyntaxColors/Color15 # COLORINDEX_HIGHLIGHTTEXT1 = Settings/SelectedWordDifferenceTextColor
DefaultSyntaxColors/Color16 # COLORINDEX_HIGHLIGHTBKGND2 = Settings/WordDifferenceColor
DefaultSyntaxColors/Color17 # COLORINDEX_HIGHLIGHTTEXT2 = Settings/WordDifferenceTextColor
DefaultSyntaxColors/Color18 # COLORINDEX_HIGHLIGHTBKGND3 = Settings/WordDifferenceDeletedColor
DefaultSyntaxColors/Color19 # COLORINDEX_HIGHLIGHTBKGND4 = Settings/SelectedWordDifferenceDeletedColor

The colors below are settings related to image comparison. There is no need to include it in the color schema file.

Settings/ImageBackColor # Background color of transparent parts set with Image → Set Background Color menu item
Settings/ImageColorDistanceThreshold # Color distance threshold set with Image → Ignore Color Difference (Color Distance Threshold) menu item. This is not a color.
Settings/ImageDiffColorAlpha # Transparency set by Block Alpha in Location Pane. This is not a color.

sdottaka avatar Nov 14 '23 22:11 sdottaka