Last 12 weeks · 0 commits
2 of 6 standards met
Fix the byte count returned from and to include the bytes in ANSI escape sequences. Both methods delegate to and methods to start and stop the excape sequence. Since both these methods are public and do not return the byte counts needed, I extracted private versions of these methods and , and redirected the and to get accurate byte counts without breaking API compatibility. Finally, is no longer deferred. If we encounter an error at any point, stop writing and return the error.
Repository: fatih/color. Description: Color package for Go (golang) Stars: 7891, Forks: 636. Primary language: Go. Languages: Go (100%). License: MIT. Homepage: https://pkg.go.dev/github.com/fatih/color Topics: ansi, color, coloring, go, golang. Latest release: v1.18.0 (1y ago). Open PRs: 13, open issues: 21. Last activity: 1mo ago. Community health: 42%. Top contributors: fatih, dependabot[bot], gregpoirson, pellared, n10v, sashamelentyev, bl-ue, zddhub, ataypamart, ilyabrin and others.
Go
Fixes #155 Adds support for the environment variable. When is set to any value other than , colors are enabled regardless of TTY detection. takes precedence over . This is useful for CI systems like GitHub Actions and GitLab CI that support ANSI colors but aren't detected as TTYs. The convention has been standardized at https://force-color.org and is already widely supported in the Node.js ecosystem (chalk, etc.) and increasingly in other languages. Changes : Added helper and integrated it into the global initialization and constructor : Added tests for , color output with , and precedence over : Documented support and updated the GitHub Actions section Testing
Add 256 color support.
Fixes #240\n\n## Changes\n- Add ANSI-aware tabwriter subpackage that ignores ANSI escapes for width calculations while preserving output\n- Document the new tabwriter usage in README and package docs\n- Add tests to verify alignment against stdlib tabwriter with ANSI stripped\n\n## Testing\n- go test ./...