{"id":19687747,"url":"https://github.com/luoxiu/rainbow","last_synced_at":"2026-03-16T08:32:21.512Z","repository":{"id":62452502,"uuid":"153762467","full_name":"luoxiu/Rainbow","owner":"luoxiu","description":"🌈 Color conversion and manipulation library for Swift with no dependence on UIKit/AppKit.","archived":false,"fork":false,"pushed_at":"2020-08-19T04:48:17.000Z","size":42,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T18:13:47.442Z","etag":null,"topics":["color","color-conversion","linux","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luoxiu.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}},"created_at":"2018-10-19T09:56:58.000Z","updated_at":"2024-06-02T17:23:04.000Z","dependencies_parsed_at":"2022-11-01T23:46:26.273Z","dependency_job_id":null,"html_url":"https://github.com/luoxiu/Rainbow","commit_stats":null,"previous_names":["jianstm/rainbow"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FRainbow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FRainbow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FRainbow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FRainbow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoxiu","download_url":"https://codeload.github.com/luoxiu/Rainbow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224156956,"owners_count":17265588,"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-conversion","linux","swift"],"created_at":"2024-11-11T18:36:05.255Z","updated_at":"2026-03-16T08:32:21.477Z","avatar_url":"https://github.com/luoxiu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rainbow\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/luoxiu/Rainbow/actions\"\u003e\n  \u003cimg src=\"https://github.com/luoxiu/Rainbow/workflows/Swift/badge.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/luoxiu/Rainbow/releases\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/tag/luoxiu/Rainbow.svg\"\u003e\n\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg\"\u003e\n\u003cimg src=\"https://img.shields.io/github/license/luoxiu/Rainbow.svg\"\u003e\n\u003c/p\u003e\n\u003cp\u003eColor conversion and manipulation library for Swift, with no rely on UIKit/AppKit.\u003c/p\u003e\n\n## Highlights\n\n- Full featured\n\t- rgba\n\t- hsla\n\t- hsva\n\t- hex\n\t- ansi\n\t- ...\n- No rely on UIKit/AppKit\n- Expressive API\n- Complete Documentation\n- Comprehensive Test Coverage\n- from\u0026to UIColor\u0026NSColor\n- Material \u0026 CSS Colors\n\n## API\n\n### Creation\n\n```swift\nlet color = Color(red: 50, green: 100, blue: 150, alpha: 1)\nlet color = Color(hue: 150, saturation: 50, lightness: 50, alpha: 1)\nlet color = Color(hue: 300, saturation: 70, value: 70, alpha: 1)\n\nlet color = Color(hex: \"#aaa\")         // \"#\" is optional\nlet color = Color(hex: \"#ABCF\")        \nlet color = Color(hex: \"#010203\")      \nlet color = Color(hex: \"#01020304\")    \n\nlet color = Color(hex: 0x0366D6)\n\nlet color = Color(rgb: \"rgb(0, 100, 200)\")         // the same as `Color(rgba:)\"\nlet color = Color(rgba: \"rgba(0, 100, 200, 0.3)\")\n\nlet color = Color(hsv: \"hsv(100, 20%, 30%)\")  // the same as `Color(hsva:)\"\nlet color = Color(hsva: \"hsva(100, 20%, 30%, 0.3)\")\n\nlet color = Color(hsl: \"hsl(100, 20%, 30%)\")  // the same as `Color(hsla:)\"\nlet color = Color(hsla: \"hsla(100, 20%, 30%, 0.3)\")\n\nlet color = Color.rgb(100, 200, 300)\nlet color = Color.hsl(100, 20, 30)\nlet color = Color.hsv(100, 20, 30)\nlet color = Color.hex(\"#0a0b0c\")\nlet color = Color.hex(0x0366D6)\n\nlet color = Color.Material.red50\nlet color = Color.Material.purple500\nlet color = Color.CSS.navy\nlet color = Color.CSS.tomato\n// ...\n```\n\n### properties\n\n```swift\nlet color = Color(hex: \"#010203\")\ncolor.rgba      // (red: Int, green: Int, blue: Int, alpha: Double)\ncolor.hsva      // (hue: Int, saturation: Double, value: Double, alpha: Double)\ncolor.hsla      // (hue: Int, saturation: Double, lightness: Double, alpha: Double)\n\ncolor.isDark    // true or false\ncolor.isLight   // true or false\ncolor.isWhite   // true or false\ncolor.isBlack   // true or false\ncolor.negate\n\ncolor.ansi16\ncolor.ansi256\n\ncolor.random    // a random color\n```\n\n## Install\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/luoxiu/Rainbow\", from(\"0.1.0\"))\n]\n```\n\n```ruby\npod 'RainbowPod', '~\u003e 0.1.0'\n```\n\n## Acknowledge\n\nInspired by the awesome javascript library [color](https://github.com/Qix-/color).\n\n## Related\n\n- [Chalk](https://github.com/luoxiu/Chalk) - 🖍 Expressive styling on terminal string.\n\n## Contribute\n\nIf you find a bug, open an issue, if you want to add new features, feel free to submit a pull request. Any contributing is welcome at all times!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxiu%2Frainbow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoxiu%2Frainbow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxiu%2Frainbow/lists"}