This repository was archived by the owner on Jan 29, 2020. It is now read-only.
[MSHARED-562] Color recognition based on color related methods' name#14
Open
antoinebrl wants to merge 1 commit intoapache:trunkfrom
antoinebrl:trunk
Open
[MSHARED-562] Color recognition based on color related methods' name#14antoinebrl wants to merge 1 commit intoapache:trunkfrom antoinebrl:trunk
antoinebrl wants to merge 1 commit intoapache:trunkfrom
antoinebrl:trunk
Conversation
The string part of enum color are no longer used. Instead, we use the name of methods related to color (starting by 'bg' or 'fg'). Thus, this modification take into account the foreground and the background color. example : -Dstyle.info=fgCyan,bgRed We can also considere the modificator bright (or other ones not yet implemented) example : -Dstyle.info=fgBrightCyan
| MOJO( "green" ), | ||
| PROJECT( "cyan" ); | ||
| MOJO( "fgGreen" ), | ||
| PROJECT( "fgCyan" ); |
There was a problem hiding this comment.
Maybe not a good idea to be as coupled as Jansi library method names for configuration purpose.
Member
|
I like adding background colors or bright colors, but not through reflection |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
this modification take into account the background color and not only the foreground one. The distinction is made by starting color name with 'bg' og 'fg'. Example of
.mavenrc:-Dstyle.info=fgCyan,bgRedThe string part of enum color are no longer used. Instead, we use the name of methods related to color in the API. To accomplish this goal we use the trick
getClasse().getMethod(name).inovoke(). Indeed all methods related to colors follow the same pattern : starting with 'bg' or 'fg' and having no arguments.Moreover, we can considere the bright modification (and other modification not yet implemented)
example :
-Dstyle.info=fgBrightCyanfgBlackfgBluefgCyanfgGreenfgMagentafgRedfgYellowbgCyanbgGreenbgMagentabgRedbgYellowfgBrightfgBrightBlackfgBrightBluefgBrightCyanfgBrightGreenfgBrightMagentafgBrightRedfgBrightYellowbgBrightbgBrightCyanbgBrightGreenbgBrightMagentabgBrightRedbgBrightYellowIf a color is missing, do a pull request with the appropriate method on JANSI project
See JANSI for details.
If the color format is not correct no color will be applied.