Skip to content
This repository has been 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
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

Conversation

antoinebrl
Copy link

@antoinebrl antoinebrl commented Jul 4, 2016

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,bgRed

The 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=fgBrightCyan

  • Colors (case ⚠️ SENSITIVE)
    • foreground
      • fgBlack
      • fgBlue
      • fgCyan
      • fgGreen
      • fgMagenta
      • fgRed
      • fgYellow
    • background
      • bgCyan
      • bgGreen
      • bgMagenta
      • bgRed
      • bgYellow
    • bright foreground
      • fgBright
      • fgBrightBlack
      • fgBrightBlue
      • fgBrightCyan
      • fgBrightGreen
      • fgBrightMagenta
      • fgBrightRed
      • fgBrightYellow
    • bright background
      • bgBright
      • bgBrightCyan
      • bgBrightGreen
      • bgBrightMagenta
      • bgBrightRed
      • bgBrightYellow

If 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.

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" );
Copy link

@seblm seblm Jul 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not a good idea to be as coupled as Jansi library method names for configuration purpose.

@hboutemy
Copy link
Member

hboutemy commented Jul 9, 2016

I like adding background colors or bright colors, but not through reflection
and not by adding "fg" to foregroung

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants