{"id":22855052,"url":"https://github.com/deinsoftware/colorify","last_synced_at":"2025-10-13T22:16:36.385Z","repository":{"id":60226112,"uuid":"115248815","full_name":"deinsoftware/colorify","owner":"deinsoftware","description":"Colorify - C# .Net Console Library with Text Format: colors, alignment and lot more [ Win+Mac+Linux ]","archived":false,"fork":false,"pushed_at":"2022-12-14T22:51:35.000Z","size":2963,"stargazers_count":70,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T23:53:41.965Z","etag":null,"topics":["alignment","colorify","colors","csharp","dotnet","dotnet-core","dotnet-framework","dotnet-standard","format-library","hacktoberfest","library","linux","macos","theme","windows"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/dein.Colorify","language":"C#","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/deinsoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["deinsoftware"],"custom":["https://paypal.me/equiman/3"]}},"created_at":"2017-12-24T08:04:29.000Z","updated_at":"2025-03-03T08:03:56.000Z","dependencies_parsed_at":"2023-01-29T01:15:27.777Z","dependency_job_id":null,"html_url":"https://github.com/deinsoftware/colorify","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/deinsoftware/colorify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deinsoftware%2Fcolorify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deinsoftware%2Fcolorify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deinsoftware%2Fcolorify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deinsoftware%2Fcolorify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deinsoftware","download_url":"https://codeload.github.com/deinsoftware/colorify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deinsoftware%2Fcolorify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017157,"owners_count":26085983,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alignment","colorify","colors","csharp","dotnet","dotnet-core","dotnet-framework","dotnet-standard","format-library","hacktoberfest","library","linux","macos","theme","windows"],"created_at":"2024-12-13T07:09:43.074Z","updated_at":"2025-10-13T22:16:36.368Z","avatar_url":"https://github.com/deinsoftware.png","language":"C#","readme":"# dein Colorify [ Win+Mac+Linux ]\n\n[![github-actions-build](https://github.com/deinsoftware/colorify/workflows/build/badge.svg?branch=master)](https://github.com/deinsoftware/colorify/actions?query=workflow%3Abuild)\n[![github-actions-pack](https://github.com/deinsoftware/colorify/workflows/pack/badge.svg)](https://github.com/deinsoftware/colorify/actions?query=workflow%3Apack)\n[![nuget-version](https://img.shields.io/nuget/v/dein.Colorify.svg)](https://www.nuget.org/packages/dein.Colorify/)\n[![nuget-download](https://img.shields.io/nuget/dt/dein.Colorify.svg)](https://www.nuget.org/packages/dein.Colorify/)\n[![Sonar-reliability](https://sonarcloud.io/api/project_badges/measure?project=dein%3Acolorify\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=dein%3Acolorify)\n[![sonar-security](https://sonarcloud.io/api/project_badges/measure?project=dein%3Acolorify\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=dein%3Acolorify)\n[![sonar-maintainability](https://sonarcloud.io/api/project_badges/measure?project=dein%3Acolorify\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=dein%3Acolorify)\n[![license](https://img.shields.io/github/license/deinsoftware/colorify)](LICENSE.md)\n\n![Colorify](.github/social/preview.png \"Colorify\")\n\n**Colorify** was created to simplify and automate tasks related to .Net console formatting. Was born in [HardHat](https://github.com/deinsoftware/hardhat/) project as a Class. Now grown up as a library and can be used by other console applications.\n\n\u003e The Code is Dark and Full of Errors!\n\u003e Console is your friend ... don't be afraid!\n\n## Menu\n\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n    - [Recommended Dependencies](#recommended-dependencies)\n    - [Add As Package](#add-as-package)\n    - [Add As Reference](#add-as-reference)\n  - [Instantiate Library](#instantiate-library)\n- [Usage](#usage)\n  - [Colors](#colors)\n  - [Write](#write)\n  - [WriteLine](#writeline)\n  - [WordWrap](#wordwrap)\n  - [Align](#align)\n  - [BlankLines](#blanklines)\n  - [DivisionLine](#divisionline)\n- [About](#about)\n  - [Built With](#built-with)\n  - [Contributing](#contributing)\n  - [Versioning](#versioning)\n  - [Authors](#authors)\n  - [Sponsors](#sponsors)\n  - [License](#license)\n  - [Acknowledgments](#acknowledgments)\n\n---\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\nWhat things you need to install?\n\n- [.Net SDK](https://www.microsoft.com/net/download)\n\n**Colorify** supports `netstandard2.1`, `netcoreapp3.1`, `net5.0`, `net6.0` and `net7.0` target frameworks.\n\n### Installing\n\n**Colorify** is available as [project](https://github.com/deinsoftware/colorify/) or [package](https://www.nuget.org/packages/dein.Colorify). We strong recommend add as a NuGet package if don't need make modifications directly on the source code library.\n\nFollow these instructions to add **Colorify** in your project.\n\n#### Recommended Dependencies\n\n- [dein.ToolBox](https://www.nuget.org/packages/dein.ToolBox) Library\n\n#### Add As Package\n\nIn your project folder, where is located .csproj file run this command on terminal:\n\n```terminal\ndotnet add package dein.Colorify\n```\n\nIf you want to use OS class highly recommend use [ToolBox](https://github.com/deinsoftware/toolbox/) project.\n\n```terminal\ndotnet add package dein.ToolBox\n```\n\nOfficial documentation: [dotnet add package](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-package)\n\n#### Add As Reference\n\nClone **Colorify** from GitHub on _recommended_ path. Using this command on terminal:\n\n| OS  | Command                                                                                      |\n| --- | -------------------------------------------------------------------------------------------- |\n| win | `git clone https://github.com/deinsoftware/colorify.git \"D:\\Developer\\DEIN\\Projects\\_devCC\"` |\n| mac | `git clone https://github.com/deinsoftware/colorify.git ~/Developer/DEIN/Projects/_devCC`    |\n\nIn your project folder, where is located .csproj file run this command on terminal:\n\n| OS  | Command                                                                             |\n| --- | ----------------------------------------------------------------------------------- |\n| win | `dotnet add reference \"D:\\Developer\\DEIN\\Projects\\_devCC\\Colorify\\Colorify.csproj\"` |\n| mac | `dotnet add reference ~/Developer/DEIN/Projects/_devCC/Colorify/Colorify.csproj`    |\n\nOfficial documentation: [dotnet add reference](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-reference)\n\n### Instantiate Library\n\nOn the main class Program, add a static property Format and inside the Main method create an instance of the library according the Operative System.\n\n```csharp\nclass Program\n{\n    public static Format _colorify {get; set;}\n\n    static void Main(string[] args)\n    {\n        switch (OS.GetCurrent())\n        {\n            case \"win\":\n            case \"gnu\":\n                _colorify = new Format(Theme.Dark);\n                break;\n            case \"mac\":\n                _colorify = new Format(Theme.Light);\n                break;\n        }\n        //Foo()\n        //Bar()\n        _colorify.ResetColor();\n        _colorify.Clear();\n    }\n}\n```\n\nTake note that `_colorify.ResetColor();` command is important in order to reset default terminal colors when programs finish.\n\nIf you want use themes with current user color use `_colorify = new Format(new ThemeLight());` or `_colorify = new Format(new ThemeDark());`\n\nIf you want to use `_colorify` in other class, add a static using to `Program` class:\n\n```csharp\nusing static Namesapace.Program;\n```\n\nreplace Namespace with a defined namespace in your project.\n\n⇧ [Back to menu](#menu)\n\n---\n\n## Usage\n\nKeep calm, you are almost done. Review this usage steps and enjoy life.\n\nTo understand how this library works, take a look inside [Sample](https://github.com/deinsoftware/colorify/tree/master/Sample) folder. Better easy to use a guide than words.\n\nJust go to `Sample` project folder and run this command on terminal:\n\n```terminal\ncd Sample\ndotnet run\n```\n\n### Colors\n\n**Colorify** colors was created inspired on [Bootstrap colors](https://getbootstrap.com/docs/4.0/utilities/colors/) a list whit a meaning easy to remember.\n\n```csharp\n_colorify.WriteLine(\"Text Default\", Colors.txtDefault);\n_colorify.WriteLine(\"Text Muted\", Colors.txtMuted);\n_colorify.WriteLine(\"Text Primary\", Colors.txtPrimary);\n_colorify.WriteLine(\"Text Success\", Colors.txtSuccess);\n_colorify.WriteLine(\"Text Info\", Colors.txtInfo);\n_colorify.WriteLine(\"Text Warning\", Colors.txtWarning);\n_colorify.WriteLine(\"Text Danger\", Colors.txtDanger);\n_colorify.WriteLine(\"Background Default\", Colors.bgDefault);\n_colorify.WriteLine(\"Background Muted\", Colors.bgMuted);\n_colorify.WriteLine(\"Background Primary\", Colors.bgPrimary);\n_colorify.WriteLine(\"Background Success\", Colors.bgSuccess);\n_colorify.WriteLine(\"Background Info\", Colors.bgInfo);\n_colorify.WriteLine(\"Background Warning\", Colors.bgWarning);\n_colorify.WriteLine(\"Background Danger\", Colors.bgDanger);\n```\n\n**Light (for macOS):**\n\n![Light](Sample/images/colors-mac.png \"Colors for macOS\")\n\n**Dark (for Windows and Linux):**\n\n![Dark](Sample/images/colors-win.png \"Colors for Window and Linux\")\n\nColors are defined on [Theme](https://github.com/deinsoftware/colorify/tree/master/Colorify/Theme) folder. There is two themes Light (for macOS) and Dark (for Windows and Linux). You can edit the `ThemeLight.cs` or `ThemeDark.cs` files or create a new one implementing the `ITheme` interface.\n\nTake a look on official documentation: [ConsoleColor Enumeration](https://msdn.microsoft.com/en-us/library/system.consolecolor)\n\n### Write\n\n`_colorify.Write` work like `Console.Write` but wrapped with colors. If you don't specify a color will use the `Colors.txtDefault` by default.\n\n```csharp\n_colorify.Write(\"Text\");\n```\n\n```csharp\n_colorify.Write(\"Text\", Colors.bgDefault);\n```\n\nYou can stack a multiple `_colorify.Write`, just remember define the last one as WriteLine.\n\n```csharp\n_colorify.Write(\" Default \", Colors.bgDefault);\n_colorify.Write(\" Muted   \", Colors.bgMuted);\n_colorify.Write(\" Primary \", Colors.bgPrimary);\n_colorify.Write(\" Success \", Colors.bgSuccess);\n_colorify.Write(\" Info    \", Colors.bgInfo);\n_colorify.Write(\" Warning \", Colors.bgWarning);\n_colorify.WriteLine(\" Danger  \", Colors.bgDanger);\n```\n\n![Write](Sample/images/write.png \"Write\")\n\n### WriteLine\n\n`_colorify.WriteLine` work like `Console.WriteLine` with a line terminator after the text but wrapped with colors. If you don't specify a color will use the `Colors.txtDefault` by default.\n\n```csharp\n_colorify.WriteLine(\"Text with line terminator\");\n```\n\n```csharp\n_colorify.WriteLine(\"Text with line terminator\", Colors.bgDefault);\n```\n\n```csharp\n_colorify.Write(\"Short Text at First Preceded with a \", Colorify.Colors.bgInfo);\n_colorify.WriteLine(\" Long Multi line text with Line Wrap that bring a new line\", Colorify.Colors.bgSuccess);\n```\n\n![WriteLine](Sample/images/writeline.png \"WriteLine\")\n\n### Word Wrap\n\n`_colorify.Wrap` works like `Console.WriteLine` with a line terminator after the text but wrapped with colors. If you don't specify a color then it will use the `Colors.txtDefault` by default.\n\n```csharp\n_colorify.Wrap(\"Very long text with gentle word wrapping at the end of console\");\n```\n\n```csharp\n_colorify.Wrap(\"Very long text with gentle word wrapping at the end of console\", Colors.bgDefault);\n```\n\nAutomatic line wrap or word wrap with long text:\n\n```csharp\n_colorify.Wrap(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sed turpis in ligula aliquet ornare tristique sed ante. Nam pretium ullamcorper condimentum. Aliquam quis sodales ex, vitae gravida metus. Suspendisse potenti. Maecenas nunc sapien, semper vel tincidunt sed, scelerisque ut est. Nunc eu venenatis libero. Nulla consectetur pretium leo. Nullam suscipit scelerisque neque fringilla volutpat. Aliquam condimentum, neque quis malesuada ultrices, mauris velit tincidunt arcu, vel sodales tortor felis quis velit. Aliquam tempus ullamcorper orci, vitae pretium leo maximus ut. Aliquam iaculis leo sed tempor mattis.\", bgWarning);\n```\n\n![WordWrap](Sample/images/wordwrap.png \"WordWrap\")\n\n### Align\n\nAll the align methods (Center/Left/Right) works like `Console.WriteLine` but with align operation and wrapped with colors. If you don't specify a color will use the `Colors.txtDefault` by default.\n\n```csharp\n_colorify.AlignCenter(\"Text Aligned to Center\");\n_colorify.AlignRight(\"Text Aligned to Right\");\n_colorify.AlignLeft(\"Text Aligned to Left\");\n```\n\n```csharp\n_colorify.AlignCenter(\"Text Aligned to Center\", Colors.bgInfo);\n_colorify.AlignRight(\"Text Aligned to Right\", Colors.txtDefault);\n_colorify.AlignLeft(\"Text Aligned to Left\", Colors.txtDanger);\n```\n\n`AlignSplit` is the way to show two values on the same line. The text will be split with pipe `|` character, the first element will be aligned to left and second aligned to right.\n\n```csharp\n_colorify.AlignSplit(\"\u003c-Text to Left| Text to Right-\u003e\");\n```\n\n```csharp\n_colorify.AlignSplit(\"\u003c-Text to Left| Text to Right-\u003e\", Colors.bgSuccess);\n```\n\n![Align](Sample/images/align.png \"Align\")\n\n### BlankLines\n\n`_colorify.BlankLines` works like `Console.WriteLine` but without text. You can combine the amount of lines and colors. Default values will be `1` line and `Colors.txtDefault`.\n\n```csharp\n_colorify.BlankLines();\n_colorify.BlankLines(Colorify.Colors.bgDanger);\n```\n\n![BlankLines](Sample/images/lines.png \"BlankLines\")\n\n```csharp\n_colorify.BlankLines(3);\n_colorify.BlankLines(3, Colors.bgSuccess);\n```\n\n![BlankLines x 3](Sample/images/lines-3.png \"BlankLines x 3\")\n\n### DivisionLine\n\n`_colorify.DivisionLine` works like `Console.WriteLine` but without the same character as full-width text. If you don't specify a color will use the `Colors.txtDefault` by default.\n\n```csharp\n_colorify.DivisionLine('-', Colors.bgDefault);\n_colorify.DivisionLine('+', Colors.bgMuted);\n_colorify.DivisionLine('~', Colors.bgPrimary);\n_colorify.DivisionLine('=', Colors.bgSuccess);\n_colorify.DivisionLine('-', Colors.bgInfo);\n_colorify.DivisionLine('*', Colors.bgWarning);\n_colorify.DivisionLine('.', Colors.bgDanger);\n```\n\n![DivisionLine](Sample/images/division.png \"DivisionLine\")\n\n⇧ [Back to menu](#menu)\n\n---\n\n## About\n\n### Built With\n\n- [.Net](https://dotnet.github.io/) - .Net is a free and open-source web framework, developed by Microsoft and the community.\n- [VS Code](https://code.visualstudio.com/) - Code editing redefined.\n- [SonarQube](https://sonarcloud.io/) - Continuous code quality.\n\n### Contributing\n\nPlease read [CONTRIBUTING](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n### Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [Colorify](https://github.com/deinsoftware/colorify/tags) on GitHub.\n\n### Authors\n\n- **Camilo Martinez** [[Equiman](http://github.com/equiman)]\n\nSee also the list of [contributors](https://github.com/deinsoftware/colorify/contributors) who participated in this project.\n\n### Sponsors\n\nIf this project help you reduce time to develop, you can give me a cup of coffee.\n\n[![GitHub Sponsors](https://img.shields.io/badge/-GitHub%20Sponsors-gray?style=flat\u0026labelColor=171515\u0026logo=github\u0026logoColor=white\u0026link=https://github.com/sponsors/deinsoftware)](https://github.com/sponsors/deinsoftware)\n[![paypal](https://img.shields.io/badge/-PayPal-gray?style=flat\u0026labelColor=00457C\u0026logo=paypal\u0026logoColor=white\u0026link=https://paypal.me/equiman/3)](https://paypal.me/equiman/3)\n\nNo sponsors yet! Will you be the first?\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.\n\n### Acknowledgments\n\n- [StackOverflow](http://stackoverflow.com): The largest online community for programmers.\n- [Dot Net Perls](https://www.dotnetperls.com/console-color): C# Console Color, Text and BackgroundColor.\n\n⇧ [Back to menu](#menu)\n","funding_links":["https://github.com/sponsors/deinsoftware","https://paypal.me/equiman/3","https://img.shields.io/badge/-GitHub%20Sponsors-gray?style=flat\u0026labelColor=171515\u0026logo=github\u0026logoColor=white\u0026link=https://github.com/sponsors/deinsoftware","https://img.shields.io/badge/-PayPal-gray?style=flat\u0026labelColor=00457C\u0026logo=paypal\u0026logoColor=white\u0026link=https://paypal.me/equiman/3"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeinsoftware%2Fcolorify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeinsoftware%2Fcolorify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeinsoftware%2Fcolorify/lists"}