Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Profile.Name() #163

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,31 @@
type Profile int

const (
// TrueColor, 24-bit color profile

Check failure on line 15 in profile.go

View workflow job for this annotation

GitHub Actions / lint-soft

Comment should end in a period (godot)
TrueColor = Profile(iota)
// ANSI256, 8-bit color profile

Check failure on line 17 in profile.go

View workflow job for this annotation

GitHub Actions / lint-soft

Comment should end in a period (godot)
ANSI256
// ANSI, 4-bit color profile

Check failure on line 19 in profile.go

View workflow job for this annotation

GitHub Actions / lint-soft

Comment should end in a period (godot)
ANSI
// Ascii, uncolored profile

Check failure on line 21 in profile.go

View workflow job for this annotation

GitHub Actions / lint-soft

Comment should end in a period (godot)
Ascii //nolint:revive
)

// Name returns the profile name as a string.
func (p Profile) Name() string {
switch p {
case Ascii:
return "Ascii"
case ANSI:
return "ANSI"
case ANSI256:
return "ANSI256"
case TrueColor:
return "TrueColor"
}
return "Unknown"
}

// String returns a new Style.
func (p Profile) String(s ...string) Style {
return Style{
Expand Down