You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sylwester Lachiewicz (Jira)" <ji...@apache.org> on 2021/12/09 01:23:00 UTC

[jira] [Assigned] (MSHARED-687) Programmatic read-only access to Color API

     [ https://issues.apache.org/jira/browse/MSHARED-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylwester Lachiewicz reassigned MSHARED-687:
--------------------------------------------

    Assignee:     (was: Guillaume Boué)

> Programmatic read-only access to Color API
> ------------------------------------------
>
>                 Key: MSHARED-687
>                 URL: https://issues.apache.org/jira/browse/MSHARED-687
>             Project: Maven Shared Components
>          Issue Type: New Feature
>          Components: maven-shared-utils
>    Affects Versions: maven-shared-utils-3.2.1
>            Reporter: Guillaume Boué
>            Priority: Minor
>
> 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:
> {code:java}
> MessageUtils.buffer().success( Style.SUCCESS.toString() )
> {code}
> in order to print the String representation of success with its own style, while not depending on JAnsi.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)