Skip to content

TheBlueHeron/ColorPicker

Repository files navigation

ColorPicker

.NET C# Platform WPF Stars Forks Issues Last Commit License

A lightweight WPF desktop application that enables color picking from the screen.

Screenshot


✨ Features

  • Windows 11 UI theme — custom implicit styles modelled on the Windows 11 design language (rounded controls, accent blue, Segoe UI Variable typography)
  • Automatic dark / light mode — reads AppsUseLightTheme from the Windows registry on startup and switches live whenever the user changes the system preference in Settings; the native title bar follows via the DWM DWMWA_USE_IMMERSIVE_DARK_MODE attribute
  • Localization — all UI strings and status messages are stored in .resx resource files; adding a new language requires only a new Strings.<culture>.resx satellite file (e.g. Strings.de.resx for German)
  • Single-file publish — releases as a self-contained-free, single win-x64 executable

🖥️ Requirements

Requirement Version
OS Windows 10 / 11 (x64)
Runtime .NET 10 Desktop Runtime

🚀 Getting Started

Run from release

  1. Download the latest executable from the Releases page.
  2. Ensure the .NET 10 Desktop Runtime is installed.
  3. Run ColorPicker.exe.

Build from source

git clone https://github.com/TheBlueHeron/ColorPicker.git
cd ColorPicker
dotnet build ColorPicker/ColorPicker.csproj

To produce a single-file release build:

dotnet publish ColorPicker/ColorPicker.csproj -c Release

🔐 Usage

  • Left-click to toggle color sampling
  • Right-click a cell in the sample grid to select a color
  • Copy color values from the sample output fields

🎨 Theming

File Role
Win11LightColors.xaml Light palette: colour tokens + named brushes
Win11DarkColors.xaml Dark palette: colour tokens + named brushes
Win11Theme.xaml Implicit styles for all controls; all brush references use DynamicResource

App.xaml.cs reads the Windows registry key AppsUseLightTheme at startup and subscribes to SystemEvents.UserPreferenceChanged to swap MergedDictionaries[0] at runtime — no restart needed. The native title bar is synchronised via DwmHelper, which calls DwmSetWindowAttribute with DWMWA_USE_IMMERSIVE_DARK_MODE.


🌍 Localization

All user-facing strings are defined in Resources/Strings.resx and accessed via the strongly-typed Strings class. XAML views use {x:Static res:Strings.XYZ} bindings.

To add a new language:

  1. Copy Resources/Strings.resx and rename it Strings.<culture>.resx (e.g. Strings.de.resx for German).
  2. Translate the <value> elements — keep all <data name="..."> keys identical.
  3. Rebuild. .NET will automatically select the correct satellite assembly based on Thread.CurrentThread.CurrentUICulture, which is set from the OS locale by default.
File Culture
Strings.resx Neutral / English (fallback)
Strings.nl.resx Dutch (nl)

🤝 Contributing

Contributions are welcome! Please open an issue first to discuss what you would like to change, then submit a pull request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

📄 License

Distributed under the Unlicense License. See LICENSE for details.

About

Color Picker

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages