A small wrapper over the lymui library. The wrapper provide binding for the specified language below
- C
- NodeJS
Uses these commands
- Compile the header for the C library
cbindgen --config cbindgen.toml --crate lymui-c --output my_header.h --lang c
- Compile lymui-node
cargo build
- Compile the example with GCC
gcc rgb.c -o test -llymui_c -L../../target/debug
- Run the example
LD_LIBRARY_PATH=../../target/debug ./test
You'll need to have NodeJS installed on your machine.
-
Go to the
node-binding
folder and run the following commandnpm run build
. This is going to output a.node
file which you can use in your npm project -
In a JS file file you can copy paste the following example.
const binding = require('../node-binding.node')
const res = binding.getAnyRgbCompatibleColor(
{ r: 5, g: 10, b: 100 },
binding.RgbMapping.Rgb,
binding.RgbMapping.Hex
)