maven-shared icon indicating copy to clipboard operation
maven-shared copied to clipboard

[MSHARED-562] Color recognition based on color related methods' name

Open antoinebrl opened this issue 9 years ago • 1 comments

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 :warning: 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.

antoinebrl avatar Jul 04 '16 21:07 antoinebrl

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

hboutemy avatar Jul 09 '16 14:07 hboutemy