WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.38k stars 791 forks source link

Documentation for themes #2069

Open StoyanDimitrov opened 11 months ago

StoyanDimitrov commented 11 months ago

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.

sdottaka commented 11 months ago

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.

StoyanDimitrov commented 11 months ago

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

sdottaka commented 11 months ago

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

StoyanDimitrov commented 10 months ago

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
sdottaka commented 10 months ago

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.