{"id":19687751,"url":"https://github.com/luoxiu/chalk","last_synced_at":"2025-04-29T07:34:43.664Z","repository":{"id":56905870,"uuid":"153726516","full_name":"luoxiu/Chalk","owner":"luoxiu","description":"✏️Expressive styling on terminal string. (chalk for swift)","archived":false,"fork":false,"pushed_at":"2020-11-17T06:14:23.000Z","size":238,"stargazers_count":59,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:45:29.999Z","etag":null,"topics":["chalk","cli","color","swift","terminal"],"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-19T04:26:56.000Z","updated_at":"2025-01-05T15:28:10.000Z","dependencies_parsed_at":"2022-08-21T01:50:38.043Z","dependency_job_id":null,"html_url":"https://github.com/luoxiu/Chalk","commit_stats":null,"previous_names":["jianstm/crayon","luoxiu/crayon"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FChalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FChalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FChalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxiu%2FChalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoxiu","download_url":"https://codeload.github.com/luoxiu/Chalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251456152,"owners_count":21592300,"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":["chalk","cli","color","swift","terminal"],"created_at":"2024-11-11T18:36:05.620Z","updated_at":"2025-04-29T07:34:43.327Z","avatar_url":"https://github.com/luoxiu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chalk\n\n\u003cdiv\u003e\n\u003ca href=\"https://github.com/luoxiu/Chalk/actions\"\u003e\n  \u003cimg src=\"https://github.com/luoxiu/Chalk/workflows/Swift/badge.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/luoxiu/Chalk/releases\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/tag/luoxiu/Chalk.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/Chalk.svg\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"chalk.jpg\"\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cstrong\u003eExpressive styling on terminal string.\u003c/strong\u003e\n\u003c/div\u003e\n\n## Highlights\n\n- Expressive API\n- 256/TrueColor support\n- Nest styles\n- Auto downgrading to terminal supported color\n- No extensions on `String`\n- rgb \u0026 hsl \u0026 hsv \u0026 hex\n- Built-in 100+ beautiful colors\n\n## Usage\n\nChalk's API is very similar to [chalk](https://github.com/chalk/chalk) -- one of the most popular packages on npm.\n\n```swift\nprint(chalk.cyan.on(\"cyan\"))  // `ck` is an alias to `chalk`\n\n// chainable\nprint(ck.red.bgBlue.italic.underline.on(\"red bgBlue italic underline\"))\n\n// combine terminal string and string\nprint(ck.red.on(\"ERROR\") + \" something went wrong. \" + ck.green.on(\"but no worry! I will...\"))\n\n// rgb \u0026 hsl \u0026 hsv \u0026 hex support\nprint(ck.fg(.rgb(0, 92, 197)).bg(.hex(0xFA4B8B)).on(\"meow\"))\n\n// custom foreground color and background color with 100+ handpicked colors\nprint(ck.fg(.darkMagenta).bg(.lightGoldenRodYellow).bold.on(\"hi\"))\n\n// nest\nprint(ck.magenta.underline.on(\"begin\" + ck.red.bold.on(\"important\") + \"end\"))\nprint(ck.magenta.underline.on(\"begin\", ck.red.bold.on(\"important\"), \"end\"))\n```\n\n## Styles\n\n### Modifiers\n\n```swift\nreset\nbold\nfaint              // aka dim, not widely supported.\nitalic\nunderline\nblink\nreverse\nconceal            // aka hidden, not widely supported.\ncrossedOut         // aka strikethrough, not widely supported.\n```\n\n### Colors\n\nThe powerful color system is built on [Rainbow](https://github.com/luoxiu/Rainbow).\n\n#### Ansi16\n\n```swift\n// with `bg` prefix will set background color\n\nblack\nred\ngreen\nyellow\nblue\nmagenta\ncyan\nwhite\n\nblackBright\nredBright\ngreenBright\nyellowBright\nblueBright\nmagentaBright\ncyanBright\nwhiteBright\n```\n\n#### 256/TrueColoe\n\n```swift\nck.fg(.rgb(0, 100, 200))\nck.fg(.hsl(300, 50, 50))\nck.fg(.hsv(300, 50, 50))\nck.bg(.hex(0x123456))\nck.bg(.hex(\"#123456\")\nck.bg(.hex(\"#abc\")\n```\n\n#### Built-in 100+ beautiful colors\n\n```swift\nlet color = Color.Material.red50\nlet color = Color.Material.purple500\nlet color = Color.CSS.navy\nlet color = Color.CSS.tomato\n\nck.fg(color)\nck.bg(color)\n//...\n```\n\n## Install\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/luoxiu/Chalk\", from: \"0.2.0\")\n]\n```\n\n```ruby\npod 'Chalk', '~\u003e 0.2.0'\n```\n\n\n## Acknowledge\n\nInspired by the awesome javascript library [chalk](https://github.com/chalk/chalk).\n\n## Related\n\n- [Rainbow](https://github.com/luoxiu/Rainbow) - 🌈 Color conversion and manipulation library for Swift with no dependence on UIKit/AppKit.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxiu%2Fchalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoxiu%2Fchalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxiu%2Fchalk/lists"}