sorairolake/csscolorparser-zig
Zig CSS color parser library
build.zig.zon
:
sh
zig fetch --save git+https://github.com/sorairolake/csscolorparser-zig.git
Add the following to your build.zig
:
zig
const csscolorparser = b.dependency("csscolorparser", .{});
exe.root_module.addImport("csscolorparser", csscolorparser.module("csscolorparser"));
Supported color formats
#RRGGBB
)
#RRGGBBAA
)
#RGB
)
#RGBA
)
rgb()
and rgba()
]
hsl()
and hsla()
]
hwb()
]
lab()
lch()
oklab()
oklch()
color()
]
Documentation
To build the documentation:
sh
zig build doc
The result is generated in zig-out/doc/csscolorparser
.
If you want to preview this, run a HTTP server locally. For example:
sh
python -m http.server -d zig-out/doc/csscolorparser
Then open http://localhost:8000/
in your browser.
Zig version
This library is compatible with Zig version 0.14.0.
Source code
The upstream repository is available at
https://github.com/sorairolake/csscolorparser-zig.git.
Changelog
Please see CHANGELOG.adoc.
Contributing
Please see CONTRIBUTING.adoc.
Acknowledgment
This library is ported from both the [csscolorparser
] crate in Rust and the
[github.com/mazznoer/csscolorparser
] package in Go.
The csscolorparser
crate v0.7.0 is distributed under the terms of either the
Apache License 2.0 or the MIT License, and the
github.com/mazznoer/csscolorparser
package v0.1.5 is distributed under the
terms of the MIT License.
License
Copyright (C) 2025 Shun Sakai (see AUTHORS.adoc)
This library is distributed under the terms of either the Apache License 2.0
or the MIT License.
This project is compliant with version 3.3 of the REUSE Specification. See
copyright notices of individual files for more details on copyright and
licensing information.