Minimal ANSI terminal colour codes, for C
woad provides the smallest useful set of fixed ANSI SGR colour sequences for library authors. It is not a console or TUI framework.
woad is the C implementation.
woad is a header-only C library. Install via CMake:
cmake -S . -B _build
cmake --build _build
cmake --install _build
Use via include:
#include <woad/woad.h>
puts(WOAD_FG_GREEN "ok" WOAD_RESET);From a clone, the Synesis helper scripts are:
./prepare_cmake.sh
./build_cmake.sh
./ctest_cmake.sh --verbose
Equivalent raw CMake:
cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release
cmake --build _build
ctest --test-dir _build --output-on-failure
woad ships SGR string macros (WOAD_RESET, WOAD_FG_*, WOAD_BG_*, including bright variants) and version macros (WOAD_VER_MAJOR, WOAD_VER_MINOR, WOAD_VER_PATCH, WOAD_VER_REVISION, WOAD_VER_ALPHABETA, WOAD_VER, WOAD_VER_STRING). TTY/stream gating and Windows virtual-terminal opt-in are not implemented yet.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/woad.
None.
- CMake 3.16 or later;
- a C11 toolchain (C90-capable MSVC is accepted on older Visual C++);
None (currently).
woad is released under the 3-clause BSD license. See LICENSE for details.