https://github.com/mishamyrt/go-syscolor
🎨 The library that allows you to get system colors
https://github.com/mishamyrt/go-syscolor
golang ui wails
Last synced: 2 months ago
JSON representation
🎨 The library that allows you to get system colors
- Host: GitHub
- URL: https://github.com/mishamyrt/go-syscolor
- Owner: mishamyrt
- License: mit
- Created: 2024-04-13T19:08:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T12:02:37.000Z (about 2 years ago)
- Last Synced: 2024-12-31T07:30:18.049Z (over 1 year ago)
- Topics: golang, ui, wails
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎨 syscolor [](https://github.com/mishamyrt/go-syscolor/actions/workflows/quality-assurance.yaml) [](https://GitHub.com/mishamyrt/go-syscolor/releases/)
A library that allows you to get system colors to build interfaces that look native.
The library implements support for:
- macOS
- Linux
- GTK
- ~~KDE~~
- ~~Windows~~
## Installation
```bash
go get -u github.com/mishamyrt/syscolor
```
## Usage
If your application is planned to run in Linux, first check if Unity or GNOME is used. I haven't found any stable methods of getting color in Plasma.
```go
func GetAccent() color.RGBA {
var systemColor color.RGBA
if runtime.GOOS == "darwin" || syscolor.IsGNOME() {
systemColor, _ = syscolor.SelectedBackground()
}
return systemColor
}
```