{"id":18278135,"url":"https://github.com/angular-rust/ux-primitives","last_synced_at":"2025-04-05T04:31:00.507Z","repository":{"id":45135975,"uuid":"341503427","full_name":"angular-rust/ux-primitives","owner":"angular-rust","description":"UX Primitives is a core graphic and color abstraction for Angular Rust","archived":false,"fork":false,"pushed_at":"2022-06-02T11:02:43.000Z","size":1300,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-20T22:18:35.703Z","etag":null,"topics":["color","color-scheme","graphic-primitives","palette","palette-colors","rust","swatches"],"latest_commit_sha":null,"homepage":"https://angular-rust.github.io/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angular-rust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null},"funding":{"ko_fi":"dudochkin","liberapay":"dudochkin","open_collective":"dudochkin"}},"created_at":"2021-02-23T09:43:26.000Z","updated_at":"2022-06-08T14:55:28.000Z","dependencies_parsed_at":"2022-09-26T21:40:39.415Z","dependency_job_id":null,"html_url":"https://github.com/angular-rust/ux-primitives","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-rust%2Fux-primitives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-rust%2Fux-primitives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-rust%2Fux-primitives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-rust%2Fux-primitives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular-rust","download_url":"https://codeload.github.com/angular-rust/ux-primitives/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289382,"owners_count":20914463,"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":["color","color-scheme","graphic-primitives","palette","palette-colors","rust","swatches"],"created_at":"2024-11-05T12:23:13.998Z","updated_at":"2025-04-05T04:30:55.472Z","avatar_url":"https://github.com/angular-rust.png","language":"Rust","funding_links":["https://ko-fi.com/dudochkin","https://liberapay.com/dudochkin","https://opencollective.com/dudochkin","https://issuehunt.io/r/angular-rust/ux-primitives/"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![](https://dudochkin-victor.github.io/assets/ux-primitives/logo-wide.svg)](#top)\n# UX Primitives\n\n[![API Docs][docrs-badge]][docrs-url]\n[![Crates.io][crates-badge]][crates-url]\n[![Code coverage][codecov-badge]][codecov-url]\n[![Tests][tests-badge]][tests-url]\n[![MPL-2.0 licensed][license-badge]][license-url]\n[![Gitter chat][gitter-badge]][gitter-url]\n[![loc][loc-badge]][loc-url]\n\u003c/div\u003e\n\n[docrs-badge]: https://img.shields.io/docsrs/ux-primitives?style=flat-square\n[docrs-url]: https://docs.rs/ux-primitives/\n[crates-badge]: https://img.shields.io/crates/v/ux-primitives.svg?style=flat-square\n[crates-url]: https://crates.io/crates/ux-primitives\n[license-badge]: https://img.shields.io/badge/license-MPL--2.0-blue.svg?style=flat-square\n[license-url]: https://github.com/angular-rust/ux-primitives/blob/master/LICENSE\n[gitter-badge]: https://img.shields.io/gitter/room/angular_rust/community.svg?style=flat-square\n[gitter-url]: https://gitter.im/angular_rust/community\n[tests-badge]: https://img.shields.io/github/workflow/status/angular-rust/ux-primitives/Tests?label=tests\u0026logo=github\u0026style=flat-square\n[tests-url]: https://github.com/angular-rust/ux-primitives/actions/workflows/tests.yml\n[codecov-badge]: https://img.shields.io/codecov/c/github/angular-rust/ux-primitives?logo=codecov\u0026style=flat-square\u0026token=RRKF1UAOSR\n[codecov-url]: https://codecov.io/gh/angular-rust/ux-primitives\n[loc-badge]: https://img.shields.io/tokei/lines/github/angular-rust/ux-primitives?style=flat-square\n[loc-url]: https://github.com/angular-rust/ux-primitives\n\nUX Primitives is a powerful library for working with color and graphics. \nIt is one of the main building blocks of the Angular Rust framework. \nThis library is well organized and easy to use. \n\nThe library provides the basic building blocks for creating games and regular applications. \nIt contains behavior definitions for game applications and basic structures.\n\nThe basic fundamental entity for graphical applications such as games is color. \nThis library contains sufficient functionality for working with color, including storage, \nprocessing and conversion between different color spaces.\n\nIt also provides support for multiple color schemes and contains the OpenColor palette \nfor the convenience and higher quality of your applications.\n\n\n## Quick Start\n\nAdd UX primitives to your project using Cargo-edit or by editing the Cargo.toml file: \n\n\tcargo add ux-primitives\n\n### Basic usage\n\n```rust\nuse primitives::prelude::*;\n\nuse primitives::foundation::{colorschemes::Tetrad, colorspace::HslColor};\n\nfn main() {\n    // Get Palette Color\n    let base = color::TEAL_9;\n\n    println!(\"Base color {}\", base.to_hex_string());\n\n    println!(\"Lighten {}\", base.lighten(10.0).to_hex_string());\n\n    println!(\"Darken {}\", base.darken(10.0).to_hex_string());\n\n    println!(\"Hue Adjusted {}\", base.adjust_hue(90.).to_hex_string());\n\n    println!(\"Complement {}\", base.complement().to_hex_string());\n\n    println!(\"Inverted {}\", base.invert().to_hex_string());\n\n    println!(\"Saturated {}\", base.saturate(50.).to_hex_string());\n\n    println!(\"Desaturated {}\", base.desaturate(50.).to_hex_string());\n\n    println!(\"Grayscale {}\", base.grayscale().to_hex_string());\n\n    let hsl: HslColor = base.into();\n\n    println!(\"{} {}\", base, hsl);\n\n    // Generate color scheme\n    let scheme = Tetrad::new(base);\n    // You can adjust color scheme parameters before get colors\n    println!();\n\n    for idx in 0..scheme.num_of_colors() {\n        match scheme.get_color(idx) {\n            Some(col) =\u003e println!(\"Color: {}\", col.to_hex_string()),\n            None =\u003e println!(\"No color\")\n        }\n    }\n}\n```\n\n## Features\n\n- [x] Graphic abstraction for native and web canvas implemented in [UX Animate](https://github.com/angular-rust/ux-animate)\n- [x] The most commonly used color spaces: RGB, RGBA, HSL, HSV, LAB, CMY, CMYK.\n- [x] Color conversion: RGB to HSL, etc.\n- [x] Support for color quantization to bring the color closer to the palette.\n- [x] Palette [Open Color](https://github.com/yeun/open-color) (4.5 thousand stars)\n- [x] Generation of color scheme according to [color theory](http://en.wikipedia.org/wiki/Color_theory).\n- [x] Basic traits for interactive applications (WIP). \n\n## Color scheme for UI design\n\nUX Primitives contain powerfull palette for easy of use and more professional look for your applications. UX Primitives use the [Open Color](https://yeun.github.io/open-color) scheme optimized for UI like font, background, border, etc.\n\n- All colors shall have adequate use\n- Provide general color for UI design\n- All colors will be beautiful in itself and harmonious\n- At the same brightness level, the perceived brightness will be constant\n\n## Learn More\n\n* [Manual, Docs, etc](https://angular-rust.github.io/)\n* [Samples](https://github.com/angular-rust/ux-samples)\n* [Apps using Angular Rust](https://github.com/angular-rust/ux-primitives/wiki/Apps-in-the-Wild)\n* [Articles Featuring Angular Rust](https://github.com/angular-rust/ux-primitives/wiki/Articles)\n\n## Community\n\n [![](https://img.shields.io/badge/Facebook-1877F2?style=for-the-badge\u0026logo=facebook\u0026logoColor=white)](https://www.facebook.com/groups/angular.rust) \n [![](https://img.shields.io/badge/Stack_Overflow-FE7A16?style=for-the-badge\u0026logo=stack-overflow\u0026logoColor=white)](https://stackoverflow.com/questions/tagged/angular-rust) \n [![](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://www.youtube.com/channel/UCBJTkSl_JWShuolUy4JksTQ) \n [![](https://img.shields.io/badge/Medium-12100E?style=for-the-badge\u0026logo=medium\u0026logoColor=white)](https://medium.com/@angular.rust) \n [![](https://img.shields.io/gitter/room/angular_rust/angular_rust?style=for-the-badge)](https://gitter.im/angular_rust/community)\n\n\n## Contributing\n\nWe believe the wider community can create better code. The first tool for improving the community is to tell the developers about the project by giving it a star. More stars - more members.\n\n  [![](https://dudochkin-victor.github.io/assets/star-me-wide.svg)](https://github.com/angular-rust/ux-primitives#top)\n\nAngular Rust is a community effort and we welcome all kinds of contributions, big or small, from developers of all backgrounds. We want the Angular Rust community to be a fun and friendly place, so please review our [Code of Conduct](CODE_OF_CONDUCT.md) to learn what behavior will not be tolerated.\n\n### New to Angular Rust?\n\nStart learning about the framework by helping us improve our [documentation](https://angular-rust.github.io/). Pull requests which improve test coverage are also very welcome.\n\n### Looking for inspiration?\n\nCheck out the community curated list of awesome things related to Angular Rust / WebAssembly at [awesome-angular-rust](https://github.com/angular-rust/awesome-angular-rust).\n\n### Confused about something?\n\nFeel free to drop into our [Gitter chatroom](https://gitter.im/angular_rust/community) or open a [new \"Question\" issue](https://github.com/angular-rust/ux-primitives/issues/new/choose) to get help from contributors. Often questions lead to improvements to the ergonomics of the framework, better documentation, and even new features!\n\n### Ready to dive into the code?\n\nAfter reviewing the [Contributing Code Guidelines](CONTRIBUTING.md), check out the [\"Good First Issues\"](https://github.com/angular-rust/ux-primitives/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) (they are eager for attention!). Once you find one that interests you, feel free to assign yourself to an issue and don't hesitate to reach out for guidance, the issues vary in complexity.\n\n### Let's help each other!\n\nCome help us on the [issues that matter that the most](https://github.com/angular-rust/ux-primitives/labels/%3Adollar%3A%20Funded%20on%20Issuehunt) and receive a small cash reward for your troubles. We use [Issuehunt](https://issuehunt.io/r/angular-rust/ux-primitives/) to fund issues from our Open Collective funds. If you really care about an issue, you can choose to add funds yourself! \n\n### Found a bug?\n\nPlease [report all bugs!](https://github.com/angular-rust/ux-primitives/issues/new/choose) We are happy to help support developers fix the bugs they find if they are interested and have the time.\n\n## Todo\n- [ ] Documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-rust%2Fux-primitives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-rust%2Fux-primitives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-rust%2Fux-primitives/lists"}