Skip to content

freethinkel/tauri-plugin-accent-color

Repository files navigation

Tauri Plugin Accent Color

A Tauri plugin to get the system accent color for macOS

Example

Install

# Cargo.toml
[dependencies]
tauri-plugin-accent-color = { git = "https://github.com/freethinkel/tauri-plugin-accent-color" }
// package.json
"dependencies": {
  "tauri-plugin-accent-color": "git+https://github.com/freethinkel/tauri-plugin-accent-color"
}

Using

// src-tauri/lib.rs
use tauri_plugin_accent_color;

pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_accent_color::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
import { accentColor } from "tauri-plugin-accent-color";

console.log(accentColor.get());

accentColor.subscribe((color) => {
  document.documentElement.style.setProperty("--color-accent", color);
});

Example

git clone https://github.com/freethinkel/tauri-plugin-accent-color
cd tauri-plugin-accent-color/example/tauri-app
npm install
npm run tauri dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published