Prism is a utility library for managing colors and colorspaces written in Zig.
WARNING
There are ongoing major API changes. Please, be cautious
and follow the development process. All changes are
documented in the code directly. Old API is already
set to be deprecated.
Prism is lightweight, fast, and easy to use in general. There is no boilerplate, just import the library, and start using colors and convert them into any of supported colorspaces, including CIE l*a*b*, which is a highly useful colorspace for working with colors that our eyes actually percept.
To use Prism you must have the source code in your project. You can either clone it, or download as an archive.
To then use it in your project, add the following to your project's build.zig
:
const prism = b.createModule(.{
.source_file = .{ .path = "/path/to/prism.zig"},
});
your_exe_or_lib.addModule("prism", prism);
To build Prism as a standalone library you must need Zig 0.11.0. Then just go into the Prism project root via cd
, and then use zig build
to build Prism. Use zig test src/tests.zig
to run tests.
All the files must be formatted and linted with zig fmt
. The code must be consistent and clean. If needed, use // zig fmt: off
and // zig fmt: on
comments.
If you are willing to make Prism better (or worse), you may follow the instructions:
- Fork Prism
- Create a new branch using git, e.g
git checkout -b feat/myfeat
- Write your dream code
- Add your changes and make a commit:
git add src/prism.zig
git commit -m "me make code"
- Open a merge request
- Wait for any contributor to review your code
- Go get some tea, because the review may take a while
- Make changes if requested by a reviewer as described previousely
- You're GTG, enjoy your profile pic in a contributors list :)
NAME | STATE | NEW |
---|---|---|
CMYK | FULL | NO |
HSI | PARTIAL | IN TODOS |
HSL | FULL | FULL |
LAB | FULL | IN TODOS |
YIQ | PARITAL | NO |
HSV | FULL | PARTIAL |
RGB | FULL | FULL |
XYZ | FULL | FULL |
- NAME - Name of the colorspace
- STATE - A colorspace support state
- FULL - A full-featured colorspace support
- PARTIAL - It kinda works, but is lacking functionality
- NO - No support at all
- IN TODOS - Planned and yet to be implemented
Prism is licensed under a BSD-3-Clause "New" or "Revised" License. See LICENSE to learn more.