{"id":22694375,"url":"https://github.com/nuiipointerexception/farbe","last_synced_at":"2025-04-12T07:35:00.824Z","repository":{"id":267368818,"uuid":"901022308","full_name":"nuIIpointerexception/farbe","owner":"nuIIpointerexception","description":"A optimized color module and library for high performance applications.","archived":false,"fork":false,"pushed_at":"2024-12-10T22:00:47.000Z","size":56,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T09:35:08.054Z","etag":null,"topics":["cpp","rust","zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuIIpointerexception.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T22:37:28.000Z","updated_at":"2024-12-16T01:11:50.000Z","dependencies_parsed_at":"2024-12-10T00:34:03.659Z","dependency_job_id":null,"html_url":"https://github.com/nuIIpointerexception/farbe","commit_stats":null,"previous_names":["nuiipointerexception/farbe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuIIpointerexception%2Ffarbe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuIIpointerexception%2Ffarbe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuIIpointerexception%2Ffarbe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuIIpointerexception%2Ffarbe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuIIpointerexception","download_url":"https://codeload.github.com/nuIIpointerexception/farbe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237172606,"owners_count":19266717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","rust","zig","zig-library","zig-package"],"created_at":"2024-12-10T03:07:33.407Z","updated_at":"2025-02-04T18:32:39.951Z","avatar_url":"https://github.com/nuIIpointerexception.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Farbe\n\nA optimized color module and library for high performance applications.\n\n## Features\n\nVarious different color formats are supported:\n- RGBA\n- HSLA\n- HSV\n\nalso we can:\n- Blending between colors\n- Hexadecimal color parsing\n- Comptime checks (Zig only)\n\n## Build\n\n### Zig\n\n```sh\nzig build [-Dtype=(static|dynamic] [-Dbinding=(c|cpp|zig]\n```\n\nDefaults:\n\n- `type` = `static`\n- `binding` = `zig`\n\n### Examples\n\n```sh\n// zig\nzig build run -Dname=ansi\n\n// c\nzig build run -Dname=c\n\n// cpp\nzig build run -Dname=cpp\n```\n\n## Usage\n\n### Zig\n\n```zig\nconst farbe = @import(\"farbe\");\n\n// Create a new RGBA color\nconst red = farbe.rgba(0xFF0000FF);\n\n// Blend two colors together\nconst blue = farbe.rgba(0x0000FFFF);\nconst purple = red.blend(blue);\n\n// Convert a color to a u32 value\nconst u32_value = red.toU32();\n\n// Create a new HSLA color\nconst hsla = farbe.hsla(0.0, 1.0, 0.5, 1.0);\n\n// Convert a color to an HSLA color\nconst hsla = red.toHsla();\n\n// Blend two colors together\nconst blue = farbe.hsla(240.0 / 360.0, 1.0, 0.5, 1.0);\nconst purple = red.blend(blue);\n\n// Convert a color to an RGBA color\nconst rgba = hsla.toRgba();\n\n// Create a new HSLA color with opacity adjusted\nconst faded = hsla.opacity(0.5);\n\n// Create a new HSLA color with opacity adjusted\nconst gray = hsla.grayscale();\n\n// Fade out a color\nhsla.fadeOut(0.5);\n```\n\n### C / C++\n\nUse the [farbe.h](include/c/farbe.h) header file provided in the include directory.\n```c++\n#include \"farbe.h\"\n\n// C\n farbe_hsla_t blue = farbe_hsla_create(240.0f/360.0f, 1.0f, 0.5f, 1.0f);\n\n// C++\nfarbe::Hsla blue = farbe::Hsla(240.0f/360.0f, 1.0f, 0.5f, 1.0f);\n```\n\n### Rust\n\nUse the [farbe-rs](include/rust/src/lib.rs) crate provided in the include directory.\n\n```rust\nuse farbe_rs::{Hsla, Rgba};\n\nlet blue = Hsla::new(240.0f/360.0f, 1.0f, 0.5f, 1.0f);\n```\n\n## License\n\nThis project is licensed under the GLPLv3 license - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuiipointerexception%2Ffarbe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuiipointerexception%2Ffarbe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuiipointerexception%2Ffarbe/lists"}