Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a refactored color scheme API for the project, deprecating the old theme functions and adding improved ANSI colors support. Key changes include replacing the direct ColorScheme pointer with a function-based approach, adding a new AnsiColorScheme function, and updating the settings and option functions accordingly.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| theme.go | Refactored color scheme functions; added DefaultColorScheme and AnsiColorScheme; updated mustColorscheme. |
| fang.go | Replaced the theme pointer with a function for colorscheme; added WithColorSchemeFunc; marked WithTheme as deprecated. |
Comments suppressed due to low confidence (2)
theme.go:115
- The signature of mustColorscheme has changed to accept a function instead of a ColorScheme pointer. Consider updating its documentation comment to clearly explain the new parameter type and usage.
func mustColorscheme(cs func(lipgloss.LightDarkFunc) ColorScheme) ColorScheme {
fang.go:28
- A comment explaining the rationale for switching from a direct ColorScheme pointer to a function type for colorscheme would improve clarity for future maintainers.
colorscheme func(lipgloss.LightDarkFunc) ColorScheme
aymanbagabas
approved these changes
Jun 23, 2025
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



based on #29
uses less colors because the code block gets quite unreadable otherwise.
also improved the mechanics of setting a colorscheme, renamed some methods, etc
looks like this: