Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
maven-shared-utils-3.2.1
-
None
-
None
Description
We should provide a way to access programmatically the Color API, without being JAnsi specific. Read-only should suffice for now, as the styles can be changed through system properties. This would allow tools, like the Help Plugin, to interact with it without depending on the implementation.
- Refactor JAnsi specific code currently in Style into AnsiMessageBuilder.
- Make Style part of public API, and add getters boolean isBold(), boolean isBright(), String getColor(), boolean isBgBright() and String getBgColor().
- Document Style.toString() to return a comma-separated list of the style components (e.g. bold,red).
- Add a public List<String> getAvailableColorNames() method to MessageUtils. Today, it would return the list of color names in the enum Ansi.Color if JAnsi is present, otherwise an empty list.
With those changes, a consumer could for example do:
MessageUtils.buffer().success( Style.SUCCESS.toString() )
in order to print the String representation of success with its own style, while not depending on JAnsi.
Attachments
Issue Links
- is required by
-
MPH-122 add help:color-style goal to describe styles color
- Open