kandi background
Explore Kits

JColor | easy syntax to format your strings with colored fonts | Command Line Interface library

 by   dialex Java Version: v5.1.0 License: MIT

 by   dialex Java Version: v5.1.0 License: MIT

Download this library from

kandi X-RAY | JColor Summary

JColor is a Java library typically used in Utilities, Command Line Interface applications. JColor has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. However JColor has 4 bugs. You can download it from GitHub.
JColor (formerly Java Colored Debug Printer) offers you an easy syntax to print messages with a colored font or background on a terminal.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • JColor has a low active ecosystem.
  • It has 269 star(s) with 37 fork(s). There are 18 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 0 open issues and 30 have been closed. On average issues are closed in 104 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of JColor is v5.1.0
JColor Support
Best in #Command Line Interface
Average in #Command Line Interface
JColor Support
Best in #Command Line Interface
Average in #Command Line Interface

quality kandi Quality

  • JColor has 4 bugs (0 blocker, 0 critical, 4 major, 0 minor) and 501 code smells.
JColor Quality
Best in #Command Line Interface
Average in #Command Line Interface
JColor Quality
Best in #Command Line Interface
Average in #Command Line Interface

securitySecurity

  • JColor has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • JColor code analysis shows 0 unresolved vulnerabilities.
  • There are 1 security hotspots that need review.
JColor Security
Best in #Command Line Interface
Average in #Command Line Interface
JColor Security
Best in #Command Line Interface
Average in #Command Line Interface

license License

  • JColor is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
JColor License
Best in #Command Line Interface
Average in #Command Line Interface
JColor License
Best in #Command Line Interface
Average in #Command Line Interface

buildReuse

  • JColor releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • JColor saves you 1401 person hours of effort in developing the same functionality from scratch.
  • It has 5512 lines of code, 162 functions and 38 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
JColor Reuse
Best in #Command Line Interface
Average in #Command Line Interface
JColor Reuse
Best in #Command Line Interface
Average in #Command Line Interface
Top functions reviewed by kandi - BETA

kandi has reviewed JColor and discovered the below as its top functions. This is intended to give you an instant insight into JColor implemented functionality, and help decide if they suit your requirements.

  • Returns the HTML code .
    • Returns the default color prefix .
      • Returns an ANSI color code
        • Returns a string representation of the code .
          • Colorizes the given text .
            • Creates an ITAL attribute .
              • Replies the UNDERLINE attribute .
                • Clears the CORS command .
                  • Format the specified text .
                    • Returns an array containing all attributes .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      JColor Key Features

                      An easy syntax to format your strings with colored fonts and backgrounds.

                      Usage

                      copy iconCopydownload iconDownload
                      // Use Case 1: use Ansi.colorize() to format inline
                      System.out.println(colorize("This text will be yellow on magenta", YELLOW_TEXT(), MAGENTA_BACK()));
                      System.out.println("\n");
                      
                      // Use Case 2: compose Attributes to create your desired format
                      Attribute[] myFormat = new Attribute[]{RED_TEXT(), YELLOW_BACK(), BOLD()};
                      System.out.println(colorize("This text will be red on yellow", myFormat));
                      System.out.println("\n");
                      
                      // Use Case 3: AnsiFormat is syntactic sugar for an array of Attributes
                      AnsiFormat fWarning = new AnsiFormat(GREEN_TEXT(), BLUE_BACK(), BOLD());
                      System.out.println(colorize("AnsiFormat is just a pretty way to declare formats", fWarning));
                      System.out.println(fWarning.format("...and use those formats without calling colorize() directly"));
                      System.out.println("\n");
                      
                      // Use Case 4: you can define your formats and use them throughout your code
                      AnsiFormat fInfo = new AnsiFormat(CYAN_TEXT());
                      AnsiFormat fError = new AnsiFormat(YELLOW_TEXT(), RED_BACK());
                      System.out.println(fInfo.format("This info message will be cyan"));
                      System.out.println("This normal message will not be formatted");
                      System.out.println(fError.format("This error message will be yellow on red"));
                      System.out.println("\n");
                      
                      // Use Case 5: we support bright colors
                      AnsiFormat fNormal = new AnsiFormat(MAGENTA_BACK(), YELLOW_TEXT());
                      AnsiFormat fBright = new AnsiFormat(BRIGHT_MAGENTA_BACK(), BRIGHT_YELLOW_TEXT());
                      System.out.println(fNormal.format("You can use normal colors ") + fBright.format(" and bright colors too"));
                      
                      // Use Case 6: we support 8-bit colors
                      System.out.println("Any 8-bit color (0-255), as long as your terminal supports it:");
                      for (int i = 0; i <= 255; i++) {
                          Attribute txtColor = TEXT_COLOR(i);
                          System.out.print(colorize(String.format("%4d", i), txtColor));
                      }
                      System.out.println("\n");
                      
                      // Use Case 7: we support true colors (RGB)
                      System.out.println("Any TrueColor (RGB), as long as your terminal supports it:");
                      for (int i = 0; i <= 300; i++) {
                          Attribute bkgColor = BACK_COLOR(randomInt(255), randomInt(255), randomInt(255));
                          System.out.print(colorize("   ", bkgColor));
                      }
                      System.out.println("\n");
                      
                      // Credits
                      System.out.print("This example used JColor 5.0.0   ");
                      System.out.print(colorize("\tMADE ", BOLD(), BRIGHT_YELLOW_TEXT(), GREEN_BACK()));
                      System.out.println(colorize("IN PORTUGAL\t", BOLD(), BRIGHT_YELLOW_TEXT(), RED_BACK()));
                      System.out.println("I hope you find it useful ;)");
                      

                      Adding symptoms table on the bars with ggplot2?

                      copy iconCopydownload iconDownload
                      # load librariy
                      library(dplyr)
                      library(ggplot2)
                      
                      # load data
                      data_url = 'https://raw.githubusercontent.com/gabrielburcea/stackoverflow_fake_data/master/labels_symptoms_ontop_of_bar_data.csv'
                      fake_data = read.csv(data_url)
                      
                      # plot
                      plot = ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      dplyr::filter(fake_data, symptoms == 'loss_appetite')
                      
                         country      symptoms    value
                      1        A loss_appetite 24.05464
                      2        A loss_appetite 24.05464
                      3        A loss_appetite 24.05464  <- 24.05
                      4        A loss_appetite 44.05464  <- 44.05
                      5        B loss_appetite 31.25430
                      6        B loss_appetite 31.25430
                      7        B loss_appetite 31.25430
                      8        B loss_appetite 31.25430
                      9        C loss_appetite 32.44539
                      10       C loss_appetite 32.44539
                      11       C loss_appetite 32.44539
                      12       C loss_appetite 32.44539
                      13       D loss_appetite 36.52090
                      14       D loss_appetite 36.52090
                      15       D loss_appetite 36.52090
                      16       D loss_appetite 36.52090
                      17       E loss_appetite 20.65789
                      
                      # create label data
                      fake_text = fake_data %>%
                        group_by(country, symptoms) %>%
                        summarize(max = max(value))
                      
                      # plot
                      ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      # load librariy
                      library(dplyr)
                      library(ggplot2)
                      
                      # load data
                      data_url = 'https://raw.githubusercontent.com/gabrielburcea/stackoverflow_fake_data/master/labels_symptoms_ontop_of_bar_data.csv'
                      fake_data = read.csv(data_url)
                      
                      # plot
                      plot = ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      dplyr::filter(fake_data, symptoms == 'loss_appetite')
                      
                         country      symptoms    value
                      1        A loss_appetite 24.05464
                      2        A loss_appetite 24.05464
                      3        A loss_appetite 24.05464  <- 24.05
                      4        A loss_appetite 44.05464  <- 44.05
                      5        B loss_appetite 31.25430
                      6        B loss_appetite 31.25430
                      7        B loss_appetite 31.25430
                      8        B loss_appetite 31.25430
                      9        C loss_appetite 32.44539
                      10       C loss_appetite 32.44539
                      11       C loss_appetite 32.44539
                      12       C loss_appetite 32.44539
                      13       D loss_appetite 36.52090
                      14       D loss_appetite 36.52090
                      15       D loss_appetite 36.52090
                      16       D loss_appetite 36.52090
                      17       E loss_appetite 20.65789
                      
                      # create label data
                      fake_text = fake_data %>%
                        group_by(country, symptoms) %>%
                        summarize(max = max(value))
                      
                      # plot
                      ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      # load librariy
                      library(dplyr)
                      library(ggplot2)
                      
                      # load data
                      data_url = 'https://raw.githubusercontent.com/gabrielburcea/stackoverflow_fake_data/master/labels_symptoms_ontop_of_bar_data.csv'
                      fake_data = read.csv(data_url)
                      
                      # plot
                      plot = ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      dplyr::filter(fake_data, symptoms == 'loss_appetite')
                      
                         country      symptoms    value
                      1        A loss_appetite 24.05464
                      2        A loss_appetite 24.05464
                      3        A loss_appetite 24.05464  <- 24.05
                      4        A loss_appetite 44.05464  <- 44.05
                      5        B loss_appetite 31.25430
                      6        B loss_appetite 31.25430
                      7        B loss_appetite 31.25430
                      8        B loss_appetite 31.25430
                      9        C loss_appetite 32.44539
                      10       C loss_appetite 32.44539
                      11       C loss_appetite 32.44539
                      12       C loss_appetite 32.44539
                      13       D loss_appetite 36.52090
                      14       D loss_appetite 36.52090
                      15       D loss_appetite 36.52090
                      16       D loss_appetite 36.52090
                      17       E loss_appetite 20.65789
                      
                      # create label data
                      fake_text = fake_data %>%
                        group_by(country, symptoms) %>%
                        summarize(max = max(value))
                      
                      # plot
                      ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      # load librariy
                      library(dplyr)
                      library(ggplot2)
                      
                      # load data
                      data_url = 'https://raw.githubusercontent.com/gabrielburcea/stackoverflow_fake_data/master/labels_symptoms_ontop_of_bar_data.csv'
                      fake_data = read.csv(data_url)
                      
                      # plot
                      plot = ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      
                      dplyr::filter(fake_data, symptoms == 'loss_appetite')
                      
                         country      symptoms    value
                      1        A loss_appetite 24.05464
                      2        A loss_appetite 24.05464
                      3        A loss_appetite 24.05464  <- 24.05
                      4        A loss_appetite 44.05464  <- 44.05
                      5        B loss_appetite 31.25430
                      6        B loss_appetite 31.25430
                      7        B loss_appetite 31.25430
                      8        B loss_appetite 31.25430
                      9        C loss_appetite 32.44539
                      10       C loss_appetite 32.44539
                      11       C loss_appetite 32.44539
                      12       C loss_appetite 32.44539
                      13       D loss_appetite 36.52090
                      14       D loss_appetite 36.52090
                      15       D loss_appetite 36.52090
                      16       D loss_appetite 36.52090
                      17       E loss_appetite 20.65789
                      
                      # create label data
                      fake_text = fake_data %>%
                        group_by(country, symptoms) %>%
                        summarize(max = max(value))
                      
                      # plot
                      ggplot(fake_data, aes(x = country, y = value, fill = symptoms)) +
                        geom_bar(stat = "identity", show.legend = FALSE,
                                 width = 0.4, position = position_dodge(width = 0.5)) +
                        coord_flip() + 
                        geom_text(aes(label = symptoms), size = 3,
                                  hjust = -0.05, position = position_dodge2(width = 0.5))
                      

                      Community Discussions

                      Trending Discussions on JColor
                      • Compiling external libraries for a terminal programs?
                      • Adding symptoms table on the bars with ggplot2?
                      Trending Discussions on JColor

                      QUESTION

                      Compiling external libraries for a terminal programs?

                      Asked 2021-Apr-22 at 19:08

                      How can I compile terminal programs which uses external libraries? I'm using JColor (https://github.com/dialex/JColor) to color my font but I don't know how to compile it.

                      My IDE is IntelliJ. I already tried to compile my program into a jar but executing it in terminal ignores JColor. No error but no color and cryptic symbols instead. I don't know if it's cause of JColor or I missed something during compiling.

                      Thank you very much in advance.

                      ANSWER

                      Answered 2021-Apr-22 at 19:08
                      Edit : The real issue

                      (See replies)

                      We found the issue not to be related to imports, but rather that ANSI control support is disabled within windows terminals by default, but enabled within IntelliJ.

                      This made it seem as though the library was not working after being exported, or wasn't being exported.

                      Relavent Discussion

                      The dependancy

                      InteliJ gives the option to export libraries with the module from within the Project Structure window:

                      Assuming the library is configured within your project, all you have to do is navigate to Project Structure > Modules > myModule > Dependencieswhere you can add the library, and tick export

                      The artifact

                      Next, create an artifact from your module, with depenencies

                      enter image description here

                      The output layout shows the internal layout of the jar after export, check the library is in there.

                      enter image description here

                      Now when you build your artifact, it should contain the dependency.

                      Source https://stackoverflow.com/questions/67200578

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install JColor

                      You can import this dependency through Maven or Gradle:.
                      JColor v5.* supports Java +8, Linux, macOS, Windows 10
                      JCDP v4.* supports Java +8, Linux, macOS, Windows 10
                      JCDP v3.* supports Java +8, Linux, macOS, Windows
                      JCDP v2.* supports Java +6, Linux, macOS, Windows
                      Javadoc
                      Changelog

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Command Line Interface Libraries
                      Try Top Libraries by dialex
                      Compare Command Line Interface Libraries with Highest Support
                      Compare Command Line Interface Libraries with Highest Quality
                      Compare Command Line Interface Libraries with Highest Security
                      Compare Command Line Interface Libraries with Permissive License
                      Compare Command Line Interface Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.