A Swift library for styling terminal strings with colors, modifiers, and 256-color support.
ColorizeSwift is a Swift library that enables developers to add colors and text styles to terminal output using a simple, chainable API. It abstracts ANSI escape codes to provide methods for applying foreground/background colors, bold, underline, and other modifiers, making command-line applications more visually engaging and readable. The library supports standard 16 colors, extended 256-color palettes, and includes utilities for disabling colorization or stripping styles.
Swift developers building command-line tools, scripts, or terminal-based applications who need to enhance output with colors and text formatting without manually handling escape codes.
Developers choose ColorizeSwift for its Swift-native API that simplifies terminal styling, support for advanced features like 256 colors and nested styles, and lightweight design without external dependencies.
Terminal string styling for Swift.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides an intuitive, native-Swift interface with method chaining for nested styling, simplifying code like 'string'.blue().underline() in the examples.
Offers extended color options via the TerminalColor enumeration, allowing access to 256 colors for richer terminal visuals, as shown in the palette image.
Enables global colorization toggling with String.isColorizationEnabled, useful for adding --no-color flags or handling piped output, per the README.
Includes an uncolorized() method to strip ANSI codes from styled strings, aiding in logging or processing where raw text is needed.
Explicitly notes that styles like italic and strikethrough are 'not widely supported,' reducing reliability across different terminal clients.
Discontinued CocoaPods integration from version 1.5, forcing users to migrate to SPM or manual addition, which may disrupt existing workflows.
Focuses solely on ANSI escape codes for styling, lacking built-in support for more complex terminal interactions like animations or layout management.