Coder Social home page Coder Social logo

dye's Introduction

Dye

Dye is a Swift library for adding styles and colors to command-line outputs.

It works in terminal simulator that supports ANSI (most on macOS and Linux), as well as older apps on Windows, such as CMD.exe.

Usage

SwiftPM/Xcode

Dye is a SwiftPM package. Add it as a dependency in Package.swift:

.package(url: "http://github.com/dduan/Pathos", from: "0.0.1")

โ€ฆ or the URL in Xcode.

CMake

Dye also builds with CMake. It works on Windows 10 and Swift 5.2.

Documentation

The file Examples/main.swift is a sample application that demonstrates most of Dye's APIs. To get a taste of how Dye works, try it out with swift run example, and take a look at its source code.

This is what the example CLI app looks like in Command Prompt on Windows:

Dye example app running in Window Command Prompt

Read the docstring in the source code for detailed API documentation.

Dye follows the NO_COLOR convention.

License

MIT. See LICENSE.md

Alternative

If you don't need Windows Support, I recommend you check out Chalk.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.