├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── bug_report.md ├── RUNBOOK.md ├── img │ ├── JColor-logo.png │ ├── JColor-logo.pxm │ ├── example-IntelliJ.png │ ├── example-mac-iterm-fancy.png │ ├── example-win-console.png │ └── repository-open-graph-template.png └── update-javadoc.sh ├── .gitignore ├── .java-version ├── .travis.yml ├── LICENSE ├── README.md ├── changelog.md ├── docs ├── allclasses-index.html ├── allpackages-index.html ├── com │ └── diogonunes │ │ └── jcolor │ │ ├── Ansi.html │ │ ├── AnsiFormat.html │ │ ├── Attribute.html │ │ ├── Command.html │ │ ├── class-use │ │ ├── Ansi.html │ │ ├── AnsiFormat.html │ │ ├── Attribute.html │ │ └── Command.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html ├── constant-values.html ├── copy.svg ├── element-list ├── help-doc.html ├── index-all.html ├── index.html ├── jquery-ui.overrides.css ├── legal │ ├── ADDITIONAL_LICENSE_INFO │ ├── ASSEMBLY_EXCEPTION │ ├── LICENSE │ ├── jquery.md │ └── jqueryUI.md ├── member-search-index.js ├── module-search-index.js ├── overview-tree.html ├── package-search-index.js ├── resources │ ├── glass.png │ └── x.png ├── script-dir │ ├── images │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_dadada_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ ├── jquery-3.5.1.min.js │ ├── jquery-ui.min.css │ ├── jquery-ui.min.js │ └── jquery-ui.structure.min.css ├── script.js ├── search.js ├── stylesheet.css ├── tag-search-index.js └── type-search-index.js ├── pom.xml └── src ├── main └── java │ └── com │ └── diogonunes │ └── jcolor │ ├── Ansi.java │ ├── AnsiFormat.java │ ├── Attribute.java │ ├── BackColorAttribute.java │ ├── ColorAttribute.java │ ├── Command.java │ ├── SimpleAttribute.java │ └── TextColorAttribute.java └── test └── java └── com └── diogonunes └── jcolor └── tests ├── acceptance └── TestHumanEye.java └── unit ├── DataGenerator.java ├── TestAnsi.java ├── TestAttribute.java ├── TestCommand.java ├── TestDataGenerator.java └── TestUsage.java /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: dialex 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with a single custom sponsorship URL 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Something that doesn't work as documented or expected 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. ... 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Environment** 24 | - OS: [e.g. Windows/Linux] 25 | - Version [e.g. 1.0.2] 26 | -------------------------------------------------------------------------------- /.github/RUNBOOK.md: -------------------------------------------------------------------------------- 1 | # Runbook 2 | 3 | How to do stuff 4 | 5 | ## Release a new version 6 | 7 | - On GitHub, 8 | - Create PR 9 | - Wait for CI results 10 | - Merge PR 11 | - Locally, 12 | - Checkout `main` 13 | - (See [Generate Javadoc](#Generate-Javadoc) 14 | - Run `mvn release:clean release:prepare` 15 | - Breaking changes, increase major (`X.*.*`) 16 | - New features or upgraded dependencies, increase minor (`*.Y.*`) 17 | - Fixing issues, increase patch (`*.*.Z`) 18 | - Run `mvn release:perform` 19 | - Run `git push` 20 | - On GitHub, 21 | - Create new release 22 | - Select tag created by maven 23 | - Describe changes 24 | 25 | ## Generate Javadoc 26 | 27 | ```sh 28 | jenv shell 18 29 | ./.github/update-javadoc.sh 30 | jenv shell 1.8 31 | git add . 32 | git commit -m "doc: update javadoc to latest version" 33 | ``` 34 | 35 | - Locally, 36 | - If after you prepared a new release... 37 | - Copy the contents of folder `target/apidocs` 38 | - If not... 39 | - Run `mvn javadoc:javadoc` to generate docs 40 | - Copy the contents of folder `target/site/apidocs/` 41 | - Delete the contents of folder `docs` 42 | - Paste your clipboard inside that folder 43 | - Run `git add .; git commit -m "doc: update to version X.Y.Z"` 44 | 45 | ## Update dependencies 46 | 47 | - Check what is outdated: `mvn versions:display-dependency-updates` 48 | - Update all of them: `mvn versions:use-latest-releases` 49 | - Check that tests still pass: `mvn test` 50 | 51 | ## Generate GPG 52 | 53 | - `gpg --gen-key` 54 | - `gpg --list-keys` 55 | - `gpg -ab README.md` (you can delete the generated file, it's just to test the key) 56 | - `gpg --keyserver keyserver.ubuntu.com --send-keys ` -------------------------------------------------------------------------------- /.github/img/JColor-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/JColor-logo.png -------------------------------------------------------------------------------- /.github/img/JColor-logo.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/JColor-logo.pxm -------------------------------------------------------------------------------- /.github/img/example-IntelliJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/example-IntelliJ.png -------------------------------------------------------------------------------- /.github/img/example-mac-iterm-fancy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/example-mac-iterm-fancy.png -------------------------------------------------------------------------------- /.github/img/example-win-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/example-win-console.png -------------------------------------------------------------------------------- /.github/img/repository-open-graph-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/.github/img/repository-open-graph-template.png -------------------------------------------------------------------------------- /.github/update-javadoc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mvn javadoc:javadoc 4 | rm -r docs 5 | cp -R target/site/apidocs docs 6 | open docs/index.html -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | ## ============================================================================ 4 | ## project secrets 5 | 6 | 7 | 8 | ## ============================================================================ 9 | ## gitignore for JAVA 10 | 11 | *.class 12 | 13 | # Mobile Tools for Java (J2ME) 14 | .mtj.tmp/ 15 | 16 | # Package Files # 17 | *.jar 18 | *.war 19 | *.ear 20 | 21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 22 | hs_err_pid* 23 | 24 | ## ============================================================================ 25 | ## gitignore for MAVEN 26 | 27 | target/ 28 | .classpath 29 | .project 30 | .settings 31 | dependency-reduced-pom.xml 32 | release.properties 33 | *.releaseBackup 34 | 35 | ## ============================================================================ 36 | ## gitignore for JetBrains: IntelliJ, Android Studio, ... 37 | 38 | .idea_modules/ 39 | .idea/ 40 | *.iml 41 | *.iws 42 | atlassian-ide-plugin.xml 43 | out/ 44 | 45 | ## ============================================================================ 46 | ## gitignore for generated files 47 | 48 | test_output/ 49 | -------------------------------------------------------------------------------- /.java-version: -------------------------------------------------------------------------------- 1 | 1.8 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - openjdk9 5 | 6 | install: 7 | - mvn install -Dgpg.skip=true 8 | 9 | script: 10 | - mvn test 11 | 12 | branches: 13 | only: 14 | - main 15 | 16 | notifications: 17 | email: 18 | on_success: never 19 | on_failure: always 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2011 Diogo Nunes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 2 | 3 | [![Maven Central](https://img.shields.io/maven-central/v/com.diogonunes/JColor)](https://mvnrepository.com/artifact/com.diogonunes/JColor) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/faaed58a577d4c3099cf8d6d4d572fb8)](https://www.codacy.com/manual/dialex-nunes/JColor?utm_source=github.com&utm_medium=referral&utm_content=dialex/JColor&utm_campaign=Badge_Grade) [![License](https://img.shields.io/github/license/dialex/JColor.svg)](https://github.com/dialex/JColor/blob/main/LICENSE) [![Donate](https://img.shields.io/badge/donate-%E2%99%A5%20-E91E63.svg)](https://www.paypal.me/dialexnunes/) 4 | 5 | **JColor** offers you an easy syntax to print messages with a colored font or background on a terminal. 6 | 7 | ### Screenshots 8 | 9 | ![JColor running on iTerm (macOS)](https://raw.githubusercontent.com/dialex/JColor/main/.github/img/example-mac-iterm-fancy.png) 10 | 11 | How it looks on different platforms: [macOS iTerm](https://raw.githubusercontent.com/dialex/JColor/main/.github/img/example-mac-iterm-fancy.png), [Windows Terminal](https://raw.githubusercontent.com/dialex/JColor/main/.github/img/example-win-console.png), [IntelliJ](https://raw.githubusercontent.com/dialex/JColor/main/.github/img/example-IntelliJ.png) 12 | 13 | ### Usage 14 | 15 | The screenshot was the result of running this [demo code](./src/test/java/com/diogonunes/jcolor/tests/acceptance/TestHumanEye.java): 16 | 17 | ```java 18 | // Use Case 1: use Ansi.colorize() to format inline 19 | System.out.println(colorize("This text will be yellow on magenta", YELLOW_TEXT(), MAGENTA_BACK())); 20 | System.out.println("\n"); 21 | 22 | // Use Case 2: compose Attributes to create your desired format 23 | Attribute[] myFormat = new Attribute[]{RED_TEXT(), YELLOW_BACK(), BOLD()}; 24 | System.out.println(colorize("This text will be red on yellow", myFormat)); 25 | System.out.println("\n"); 26 | 27 | // Use Case 3: AnsiFormat is syntactic sugar for an array of Attributes 28 | AnsiFormat fWarning = new AnsiFormat(GREEN_TEXT(), BLUE_BACK(), BOLD()); 29 | System.out.println(colorize("AnsiFormat is just a pretty way to declare formats", fWarning)); 30 | System.out.println(fWarning.format("...and use those formats without calling colorize() directly")); 31 | System.out.println("\n"); 32 | 33 | // Use Case 4: you can define your formats and use them throughout your code 34 | AnsiFormat fInfo = new AnsiFormat(CYAN_TEXT()); 35 | AnsiFormat fError = new AnsiFormat(YELLOW_TEXT(), RED_BACK()); 36 | System.out.println(fInfo.format("This info message will be cyan")); 37 | System.out.println("This normal message will not be formatted"); 38 | System.out.println(fError.format("This error message will be yellow on red")); 39 | System.out.println("\n"); 40 | 41 | // Use Case 5: we support bright colors 42 | AnsiFormat fNormal = new AnsiFormat(MAGENTA_BACK(), YELLOW_TEXT()); 43 | AnsiFormat fBright = new AnsiFormat(BRIGHT_MAGENTA_BACK(), BRIGHT_YELLOW_TEXT()); 44 | System.out.println(fNormal.format("You can use normal colors ") + fBright.format(" and bright colors too")); 45 | 46 | // Use Case 6: we support 8-bit colors 47 | System.out.println("Any 8-bit color (0-255), as long as your terminal supports it:"); 48 | for (int i = 0; i <= 255; i++) { 49 | Attribute txtColor = TEXT_COLOR(i); 50 | System.out.print(colorize(String.format("%4d", i), txtColor)); 51 | } 52 | System.out.println("\n"); 53 | 54 | // Use Case 7: we support true colors (RGB) 55 | System.out.println("Any TrueColor (RGB), as long as your terminal supports it:"); 56 | for (int i = 0; i <= 300; i++) { 57 | Attribute bkgColor = BACK_COLOR(randomInt(255), randomInt(255), randomInt(255)); 58 | System.out.print(colorize(" ", bkgColor)); 59 | } 60 | System.out.println("\n"); 61 | 62 | // Credits 63 | System.out.print("This example used JColor 5.0.0 "); 64 | System.out.print(colorize("\tMADE ", BOLD(), BRIGHT_YELLOW_TEXT(), GREEN_BACK())); 65 | System.out.println(colorize("IN PORTUGAL\t", BOLD(), BRIGHT_YELLOW_TEXT(), RED_BACK())); 66 | System.out.println("I hope you find it useful ;)"); 67 | ``` 68 | 69 | #### Installation 70 | 71 | You can import this dependency through Maven or Gradle: 72 | 73 | - [JColor](https://mvnrepository.com/artifact/com.diogonunes/JColor) `v5.*` supports Java 8+, Linux, macOS, Windows* 10+ 74 | - [JCDP](https://mvnrepository.com/artifact/com.diogonunes/JCDP) `v4.*` supports Java 8+, Linux, macOS, Windows* 10+ 75 | - JCDP `v3.*` supports Java 8+, Linux, macOS, Windows 76 | - JCDP `v2.*` supports Java 6+, Linux, macOS, Windows 77 | 78 | ##### Troubleshoot 79 | 80 | > ⚠️ *Windows users, attention! 81 | > 82 | > Even though Windows 10 has support for ANSI escape sequences, it is [disabled by default](https://stackoverflow.com/questions/51680709/colored-text-output-in-powershell-console-using-ansi-vt100-codes/51681675#51681675). The easiest way to fix this is to use [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701), otherwise pick one of these [workarounds](https://github.com/dialex/JColor/issues/62#issuecomment-967010670). 83 | 84 | #### Useful links 85 | 86 | - [Javadoc](https://dialex.github.io/JColor/) 87 | - [Changelog](https://github.com/dialex/JColor/releases/) 88 | 89 | ### License 90 | 91 | JColor, former JCDP Copyright (C) 2011-\* [Diogo Nunes](https://www.diogonunes.com/) 92 | This program is licensed under the terms of the MIT License and it comes with ABSOLUTELY NO WARRANTY. For more details check LICENSE. 93 | 94 | ### Credits 95 | 96 | A big thanks to all [contributors](https://github.com/dialex/JColor/graphs/contributors), namely [@xafero](https://github.com/xafero) who _maven-ized_ this project. 97 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Release Changelog 2 | 3 | [See GitHub releases](https://github.com/dialex/JColor/releases) -------------------------------------------------------------------------------- /docs/allclasses-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Classes and Interfaces (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

All Classes and Interfaces

52 |
53 |
54 |
Classes
55 |
56 |
Class
57 |
Description
58 | 59 |
60 |
Provides a fluent API to generate 61 | ANSI escape sequences 62 | by specifying Attributes of your format.
63 |
64 | 65 |
66 |
Abstracts an Array of Attributes.
67 |
68 | 69 |
70 |
Abstracts ANSI codes with intuitive names.
71 |
72 | 73 |
74 |
Abstracts ANSI codes with intuitive names.
75 |
76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 |
84 |
85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

All Packages

52 |
53 |
Package Summary
54 |
55 |
Package
56 |
Description
57 | 58 |
 
59 |
60 |
61 |
62 |
63 | 64 |
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/AnsiFormat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AnsiFormat (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 28 |
29 | 86 |
87 |
88 | 89 |
90 | 91 |

Class AnsiFormat

92 |
93 |
java.lang.Object 94 |
com.diogonunes.jcolor.AnsiFormat
95 |
96 |
97 |
98 |
public class AnsiFormat 99 | extends Object
100 |
Abstracts an Array of Attributes. 101 | Use it if you find this more readable than Attribute[].
102 |
103 |
104 | 144 |
145 |
146 |
    147 | 148 |
  • 149 |
    150 |

    Constructor Details

    151 |
      152 |
    • 153 |
      154 |

      AnsiFormat

      155 |
      public AnsiFormat(Attribute... attributes)
      156 |
      157 |
      Parameters:
      158 |
      attributes - All ANSI attributes to format a text.
      159 |
      160 |
      161 |
    • 162 |
    163 |
    164 |
  • 165 | 166 |
  • 167 |
    168 |

    Method Details

    169 |
      170 |
    • 171 |
      172 |

      format

      173 |
      public String format(String text)
      174 |
      175 |
      Parameters:
      176 |
      text - String to format.
      177 |
      Returns:
      178 |
      The formatted string, ready to be printed.
      179 |
      180 |
      181 |
    • 182 |
    • 183 |
      184 |

      toArray

      185 |
      protected Attribute[] toArray()
      186 |
      187 |
    • 188 |
    189 |
    190 |
  • 191 |
192 |
193 | 194 |
195 |
196 |
197 | 198 |
199 |
200 |
201 | 202 | 203 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/Command.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Command (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 28 |
29 | 86 |
87 |
88 | 89 |
90 | 91 |

Class Command

92 |
93 |
java.lang.Object 94 |
com.diogonunes.jcolor.Command
95 |
96 |
97 |
98 |
public class Command 99 | extends Object
100 |
Abstracts ANSI codes with intuitive names. It maps a command (e.g. CLEAR_SCREEN) with a code.
101 |
102 |
103 | 130 |
131 |
132 |
    133 | 134 |
  • 135 |
    136 |

    Method Details

    137 |
      138 |
    • 139 |
      140 |

      CLEAR_SCREEN

      141 |
      public static Command CLEAR_SCREEN()
      142 |
      143 |
      Returns:
      144 |
      Clears the terminal's text, e.g. just like the command-line `clear`.
      145 |
      146 |
      147 |
    • 148 |
    • 149 |
      150 |

      toString

      151 |
      public String toString()
      152 |
      153 |
      Overrides:
      154 |
      toString in class Object
      155 |
      156 |
      157 |
    • 158 |
    159 |
    160 |
  • 161 |
162 |
163 | 164 |
165 |
166 |
167 | 168 |
169 |
170 |
171 | 172 | 173 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/class-use/Ansi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Class com.diogonunes.jcolor.Ansi (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Uses of Class
com.diogonunes.jcolor.Ansi

52 |
53 | No usage of com.diogonunes.jcolor.Ansi
54 |
55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/class-use/AnsiFormat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Class com.diogonunes.jcolor.AnsiFormat (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Uses of Class
com.diogonunes.jcolor.AnsiFormat

52 |
53 |
54 | 74 |
75 |
76 |
77 |
78 | 79 |
80 |
81 |
82 | 83 | 84 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/class-use/Command.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Class com.diogonunes.jcolor.Command (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Uses of Class
com.diogonunes.jcolor.Command

52 |
53 |
54 | 82 |
83 |
84 |
85 |
86 | 87 |
88 |
89 |
90 | 91 | 92 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.diogonunes.jcolor (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 66 |
67 |
68 |
69 |

Package com.diogonunes.jcolor

70 |
71 |
72 |
package com.diogonunes.jcolor
73 |
74 |
    75 |
  • 76 |
    77 |
    Classes
    78 |
    79 |
    Class
    80 |
    Description
    81 | 82 |
    83 |
    Provides a fluent API to generate 84 | ANSI escape sequences 85 | by specifying Attributes of your format.
    86 |
    87 | 88 |
    89 |
    Abstracts an Array of Attributes.
    90 |
    91 | 92 |
    93 |
    Abstracts ANSI codes with intuitive names.
    94 |
    95 | 96 |
    97 |
    Abstracts ANSI codes with intuitive names.
    98 |
    99 |
    100 |
    101 |
  • 102 |
103 |
104 |
105 |
106 |
107 | 108 |
109 |
110 |
111 | 112 | 113 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.diogonunes.jcolor Class Hierarchy (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Hierarchy For Package com.diogonunes.jcolor

52 |
53 |
54 |

Class Hierarchy

55 |
    56 |
  • java.lang.Object 57 | 63 |
  • 64 |
65 |
66 |
67 |
68 |
69 | 70 |
71 |
72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/com/diogonunes/jcolor/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.diogonunes.jcolor (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Uses of Package
com.diogonunes.jcolor

52 |
53 |
54 | 77 |
78 |
79 |
80 |
81 | 82 |
83 |
84 |
85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Constant Field Values (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Constant Field Values

52 |
53 |

Contents

54 | 57 |
58 |
59 |
60 |

com.diogonunes.*

61 |
    62 |
  • 63 |
    com.diogonunes.jcolor.Ansi
    64 |
    65 |
    Modifier and Type
    66 |
    Constant Field
    67 |
    Value
    68 |
    public static final String
    69 | 70 |
    "m"
    71 |
    public static final String
    72 | 73 |
    "\u001b["
    74 |
    public static final String
    75 | 76 |
    ";"
    77 |
    78 |
  • 79 |
80 |
81 |
82 |
83 |
84 | 85 |
86 |
87 |
88 | 89 | 90 | -------------------------------------------------------------------------------- /docs/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 27 | 28 | 29 | 31 | 33 | 34 | -------------------------------------------------------------------------------- /docs/element-list: -------------------------------------------------------------------------------- 1 | com.diogonunes.jcolor 2 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | API Help (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 64 |
65 |
66 |

JavaDoc Help

67 | 87 |
88 |
89 |

Navigation

90 | Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces 91 | 101 |
102 |
103 |
104 |

Kinds of Pages

105 | The following sections describe the different kinds of pages in this collection. 106 |
107 |

Package

108 |

Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:

109 |
    110 |
  • Interfaces
  • 111 |
  • Classes
  • 112 |
  • Enums
  • 113 |
  • Exception Classes
  • 114 |
  • Annotation Types
  • 115 |
116 |
117 |
118 |

Class or Interface

119 |

Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.

120 |
    121 |
  • Class Inheritance Diagram
  • 122 |
  • Direct Subclasses
  • 123 |
  • All Known Subinterfaces
  • 124 |
  • All Known Implementing Classes
  • 125 |
  • Class or Interface Declaration
  • 126 |
  • Class or Interface Description
  • 127 |
128 |
129 |
    130 |
  • Nested Class Summary
  • 131 |
  • Enum Constant Summary
  • 132 |
  • Field Summary
  • 133 |
  • Property Summary
  • 134 |
  • Constructor Summary
  • 135 |
  • Method Summary
  • 136 |
  • Required Element Summary
  • 137 |
  • Optional Element Summary
  • 138 |
139 |
140 |
    141 |
  • Enum Constant Details
  • 142 |
  • Field Details
  • 143 |
  • Property Details
  • 144 |
  • Constructor Details
  • 145 |
  • Method Details
  • 146 |
  • Element Details
  • 147 |
148 |

Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.

149 |

The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

150 |
151 |
152 |

Other Files

153 |

Packages and modules may contain pages with additional information related to the declarations nearby.

154 |
155 |
156 |

Use

157 |

Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the USE link in the navigation bar.

158 |
159 |
160 |

Tree (Class Hierarchy)

161 |

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

162 |
    163 |
  • When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
  • 164 |
  • When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
  • 165 |
166 |
167 |
168 |

Constant Field Values

169 |

The Constant Field Values page lists the static final fields and their values.

170 |
171 |
172 |

All Packages

173 |

The All Packages page contains an alphabetic index of all packages contained in the documentation.

174 |
175 |
176 |

All Classes and Interfaces

177 |

The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.

178 |
179 |
180 |

Index

181 |

The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.

182 |
183 |
184 |
185 | This help file applies to API documentation generated by the standard doclet.
186 |
187 |
188 | 189 |
190 |
191 |
192 | 193 | 194 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.diogonunes:JColor 5.5.2-SNAPSHOT API 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 |
20 | 23 |

com/diogonunes/jcolor/package-summary.html

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/jquery-ui.overrides.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | .ui-state-active, 27 | .ui-widget-content .ui-state-active, 28 | .ui-widget-header .ui-state-active, 29 | a.ui-button:active, 30 | .ui-button:active, 31 | .ui-button.ui-state-active:hover { 32 | /* Overrides the color of selection used in jQuery UI */ 33 | background: #F8981D; 34 | } 35 | -------------------------------------------------------------------------------- /docs/legal/ADDITIONAL_LICENSE_INFO: -------------------------------------------------------------------------------- 1 | ADDITIONAL INFORMATION ABOUT LICENSING 2 | 3 | Certain files distributed by Oracle America, Inc. and/or its affiliates are 4 | subject to the following clarification and special exception to the GPLv2, 5 | based on the GNU Project exception for its Classpath libraries, known as the 6 | GNU Classpath Exception. 7 | 8 | Note that Oracle includes multiple, independent programs in this software 9 | package. Some of those programs are provided under licenses deemed 10 | incompatible with the GPLv2 by the Free Software Foundation and others. 11 | For example, the package includes programs licensed under the Apache 12 | License, Version 2.0 and may include FreeType. Such programs are licensed 13 | to you under their original licenses. 14 | 15 | Oracle facilitates your further distribution of this package by adding the 16 | Classpath Exception to the necessary parts of its GPLv2 code, which permits 17 | you to use that code in combination with other independent modules not 18 | licensed under the GPLv2. However, note that this would not permit you to 19 | commingle code under an incompatible license with Oracle's GPLv2 licensed 20 | code by, for example, cutting and pasting such code into a file also 21 | containing Oracle's GPLv2 licensed code and then distributing the result. 22 | 23 | Additionally, if you were to remove the Classpath Exception from any of the 24 | files to which it applies and distribute the result, you would likely be 25 | required to license some or all of the other code in that distribution under 26 | the GPLv2 as well, and since the GPLv2 is incompatible with the license terms 27 | of some items included in the distribution by Oracle, removing the Classpath 28 | Exception could therefore effectively compromise your ability to further 29 | distribute the package. 30 | 31 | Failing to distribute notices associated with some files may also create 32 | unexpected legal consequences. 33 | 34 | Proceed with caution and we recommend that you obtain the advice of a lawyer 35 | skilled in open source matters before removing the Classpath Exception or 36 | making modifications to this package which may subsequently be redistributed 37 | and/or involve the use of third party software. 38 | -------------------------------------------------------------------------------- /docs/legal/ASSEMBLY_EXCEPTION: -------------------------------------------------------------------------------- 1 | 2 | OPENJDK ASSEMBLY EXCEPTION 3 | 4 | The OpenJDK source code made available by Oracle America, Inc. (Oracle) at 5 | openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU 6 | General Public License version 2 7 | only ("GPL2"), with the following clarification and special exception. 8 | 9 | Linking this OpenJDK Code statically or dynamically with other code 10 | is making a combined work based on this library. Thus, the terms 11 | and conditions of GPL2 cover the whole combination. 12 | 13 | As a special exception, Oracle gives you permission to link this 14 | OpenJDK Code with certain code licensed by Oracle as indicated at 15 | http://openjdk.java.net/legal/exception-modules-2007-05-08.html 16 | ("Designated Exception Modules") to produce an executable, 17 | regardless of the license terms of the Designated Exception Modules, 18 | and to copy and distribute the resulting executable under GPL2, 19 | provided that the Designated Exception Modules continue to be 20 | governed by the licenses under which they were offered by Oracle. 21 | 22 | As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code 23 | to build an executable that includes those portions of necessary code that 24 | Oracle could not provide under GPL2 (or that Oracle has provided under GPL2 25 | with the Classpath exception). If you modify or add to the OpenJDK code, 26 | that new GPL2 code may still be combined with Designated Exception Modules 27 | if the new code is made subject to this exception by its copyright holder. 28 | -------------------------------------------------------------------------------- /docs/legal/LICENSE: -------------------------------------------------------------------------------- 1 | The GNU General Public License (GPL) 2 | 3 | Version 2, June 1991 4 | 5 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this license 9 | document, but changing it is not allowed. 10 | 11 | Preamble 12 | 13 | The licenses for most software are designed to take away your freedom to share 14 | and change it. By contrast, the GNU General Public License is intended to 15 | guarantee your freedom to share and change free software--to make sure the 16 | software is free for all its users. This General Public License applies to 17 | most of the Free Software Foundation's software and to any other program whose 18 | authors commit to using it. (Some other Free Software Foundation software is 19 | covered by the GNU Library General Public License instead.) You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not price. Our 23 | General Public Licenses are designed to make sure that you have the freedom to 24 | distribute copies of free software (and charge for this service if you wish), 25 | that you receive source code or can get it if you want it, that you can change 26 | the software or use pieces of it in new free programs; and that you know you 27 | can do these things. 28 | 29 | To protect your rights, we need to make restrictions that forbid anyone to deny 30 | you these rights or to ask you to surrender the rights. These restrictions 31 | translate to certain responsibilities for you if you distribute copies of the 32 | software, or if you modify it. 33 | 34 | For example, if you distribute copies of such a program, whether gratis or for 35 | a fee, you must give the recipients all the rights that you have. You must 36 | make sure that they, too, receive or can get the source code. And you must 37 | show them these terms so they know their rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and (2) 40 | offer you this license which gives you legal permission to copy, distribute 41 | and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain that 44 | everyone understands that there is no warranty for this free software. If the 45 | software is modified by someone else and passed on, we want its recipients to 46 | know that what they have is not the original, so that any problems introduced 47 | by others will not reflect on the original authors' reputations. 48 | 49 | Finally, any free program is threatened constantly by software patents. We 50 | wish to avoid the danger that redistributors of a free program will 51 | individually obtain patent licenses, in effect making the program proprietary. 52 | To prevent this, we have made it clear that any patent must be licensed for 53 | everyone's free use or not licensed at all. 54 | 55 | The precise terms and conditions for copying, distribution and modification 56 | follow. 57 | 58 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 59 | 60 | 0. This License applies to any program or other work which contains a notice 61 | placed by the copyright holder saying it may be distributed under the terms of 62 | this General Public License. The "Program", below, refers to any such program 63 | or work, and a "work based on the Program" means either the Program or any 64 | derivative work under copyright law: that is to say, a work containing the 65 | Program or a portion of it, either verbatim or with modifications and/or 66 | translated into another language. (Hereinafter, translation is included 67 | without limitation in the term "modification".) Each licensee is addressed as 68 | "you". 69 | 70 | Activities other than copying, distribution and modification are not covered by 71 | this License; they are outside its scope. The act of running the Program is 72 | not restricted, and the output from the Program is covered only if its contents 73 | constitute a work based on the Program (independent of having been made by 74 | running the Program). Whether that is true depends on what the Program does. 75 | 76 | 1. You may copy and distribute verbatim copies of the Program's source code as 77 | you receive it, in any medium, provided that you conspicuously and 78 | appropriately publish on each copy an appropriate copyright notice and 79 | disclaimer of warranty; keep intact all the notices that refer to this License 80 | and to the absence of any warranty; and give any other recipients of the 81 | Program a copy of this License along with the Program. 82 | 83 | You may charge a fee for the physical act of transferring a copy, and you may 84 | at your option offer warranty protection in exchange for a fee. 85 | 86 | 2. You may modify your copy or copies of the Program or any portion of it, thus 87 | forming a work based on the Program, and copy and distribute such modifications 88 | or work under the terms of Section 1 above, provided that you also meet all of 89 | these conditions: 90 | 91 | a) You must cause the modified files to carry prominent notices stating 92 | that you changed the files and the date of any change. 93 | 94 | b) You must cause any work that you distribute or publish, that in whole or 95 | in part contains or is derived from the Program or any part thereof, to be 96 | licensed as a whole at no charge to all third parties under the terms of 97 | this License. 98 | 99 | c) If the modified program normally reads commands interactively when run, 100 | you must cause it, when started running for such interactive use in the 101 | most ordinary way, to print or display an announcement including an 102 | appropriate copyright notice and a notice that there is no warranty (or 103 | else, saying that you provide a warranty) and that users may redistribute 104 | the program under these conditions, and telling the user how to view a copy 105 | of this License. (Exception: if the Program itself is interactive but does 106 | not normally print such an announcement, your work based on the Program is 107 | not required to print an announcement.) 108 | 109 | These requirements apply to the modified work as a whole. If identifiable 110 | sections of that work are not derived from the Program, and can be reasonably 111 | considered independent and separate works in themselves, then this License, and 112 | its terms, do not apply to those sections when you distribute them as separate 113 | works. But when you distribute the same sections as part of a whole which is a 114 | work based on the Program, the distribution of the whole must be on the terms 115 | of this License, whose permissions for other licensees extend to the entire 116 | whole, and thus to each and every part regardless of who wrote it. 117 | 118 | Thus, it is not the intent of this section to claim rights or contest your 119 | rights to work written entirely by you; rather, the intent is to exercise the 120 | right to control the distribution of derivative or collective works based on 121 | the Program. 122 | 123 | In addition, mere aggregation of another work not based on the Program with the 124 | Program (or with a work based on the Program) on a volume of a storage or 125 | distribution medium does not bring the other work under the scope of this 126 | License. 127 | 128 | 3. You may copy and distribute the Program (or a work based on it, under 129 | Section 2) in object code or executable form under the terms of Sections 1 and 130 | 2 above provided that you also do one of the following: 131 | 132 | a) Accompany it with the complete corresponding machine-readable source 133 | code, which must be distributed under the terms of Sections 1 and 2 above 134 | on a medium customarily used for software interchange; or, 135 | 136 | b) Accompany it with a written offer, valid for at least three years, to 137 | give any third party, for a charge no more than your cost of physically 138 | performing source distribution, a complete machine-readable copy of the 139 | corresponding source code, to be distributed under the terms of Sections 1 140 | and 2 above on a medium customarily used for software interchange; or, 141 | 142 | c) Accompany it with the information you received as to the offer to 143 | distribute corresponding source code. (This alternative is allowed only 144 | for noncommercial distribution and only if you received the program in 145 | object code or executable form with such an offer, in accord with 146 | Subsection b above.) 147 | 148 | The source code for a work means the preferred form of the work for making 149 | modifications to it. For an executable work, complete source code means all 150 | the source code for all modules it contains, plus any associated interface 151 | definition files, plus the scripts used to control compilation and installation 152 | of the executable. However, as a special exception, the source code 153 | distributed need not include anything that is normally distributed (in either 154 | source or binary form) with the major components (compiler, kernel, and so on) 155 | of the operating system on which the executable runs, unless that component 156 | itself accompanies the executable. 157 | 158 | If distribution of executable or object code is made by offering access to copy 159 | from a designated place, then offering equivalent access to copy the source 160 | code from the same place counts as distribution of the source code, even though 161 | third parties are not compelled to copy the source along with the object code. 162 | 163 | 4. You may not copy, modify, sublicense, or distribute the Program except as 164 | expressly provided under this License. Any attempt otherwise to copy, modify, 165 | sublicense or distribute the Program is void, and will automatically terminate 166 | your rights under this License. However, parties who have received copies, or 167 | rights, from you under this License will not have their licenses terminated so 168 | long as such parties remain in full compliance. 169 | 170 | 5. You are not required to accept this License, since you have not signed it. 171 | However, nothing else grants you permission to modify or distribute the Program 172 | or its derivative works. These actions are prohibited by law if you do not 173 | accept this License. Therefore, by modifying or distributing the Program (or 174 | any work based on the Program), you indicate your acceptance of this License to 175 | do so, and all its terms and conditions for copying, distributing or modifying 176 | the Program or works based on it. 177 | 178 | 6. Each time you redistribute the Program (or any work based on the Program), 179 | the recipient automatically receives a license from the original licensor to 180 | copy, distribute or modify the Program subject to these terms and conditions. 181 | You may not impose any further restrictions on the recipients' exercise of the 182 | rights granted herein. You are not responsible for enforcing compliance by 183 | third parties to this License. 184 | 185 | 7. If, as a consequence of a court judgment or allegation of patent 186 | infringement or for any other reason (not limited to patent issues), conditions 187 | are imposed on you (whether by court order, agreement or otherwise) that 188 | contradict the conditions of this License, they do not excuse you from the 189 | conditions of this License. If you cannot distribute so as to satisfy 190 | simultaneously your obligations under this License and any other pertinent 191 | obligations, then as a consequence you may not distribute the Program at all. 192 | For example, if a patent license would not permit royalty-free redistribution 193 | of the Program by all those who receive copies directly or indirectly through 194 | you, then the only way you could satisfy both it and this License would be to 195 | refrain entirely from distribution of the Program. 196 | 197 | If any portion of this section is held invalid or unenforceable under any 198 | particular circumstance, the balance of the section is intended to apply and 199 | the section as a whole is intended to apply in other circumstances. 200 | 201 | It is not the purpose of this section to induce you to infringe any patents or 202 | other property right claims or to contest validity of any such claims; this 203 | section has the sole purpose of protecting the integrity of the free software 204 | distribution system, which is implemented by public license practices. Many 205 | people have made generous contributions to the wide range of software 206 | distributed through that system in reliance on consistent application of that 207 | system; it is up to the author/donor to decide if he or she is willing to 208 | distribute software through any other system and a licensee cannot impose that 209 | choice. 210 | 211 | This section is intended to make thoroughly clear what is believed to be a 212 | consequence of the rest of this License. 213 | 214 | 8. If the distribution and/or use of the Program is restricted in certain 215 | countries either by patents or by copyrighted interfaces, the original 216 | copyright holder who places the Program under this License may add an explicit 217 | geographical distribution limitation excluding those countries, so that 218 | distribution is permitted only in or among countries not thus excluded. In 219 | such case, this License incorporates the limitation as if written in the body 220 | of this License. 221 | 222 | 9. The Free Software Foundation may publish revised and/or new versions of the 223 | General Public License from time to time. Such new versions will be similar in 224 | spirit to the present version, but may differ in detail to address new problems 225 | or concerns. 226 | 227 | Each version is given a distinguishing version number. If the Program 228 | specifies a version number of this License which applies to it and "any later 229 | version", you have the option of following the terms and conditions either of 230 | that version or of any later version published by the Free Software Foundation. 231 | If the Program does not specify a version number of this License, you may 232 | choose any version ever published by the Free Software Foundation. 233 | 234 | 10. If you wish to incorporate parts of the Program into other free programs 235 | whose distribution conditions are different, write to the author to ask for 236 | permission. For software which is copyrighted by the Free Software Foundation, 237 | write to the Free Software Foundation; we sometimes make exceptions for this. 238 | Our decision will be guided by the two goals of preserving the free status of 239 | all derivatives of our free software and of promoting the sharing and reuse of 240 | software generally. 241 | 242 | NO WARRANTY 243 | 244 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 245 | THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE 246 | STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE 247 | PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 248 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 249 | FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 250 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, 251 | YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 252 | 253 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL 254 | ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE 255 | PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 256 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 257 | INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 258 | BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 259 | FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER 260 | OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 261 | 262 | END OF TERMS AND CONDITIONS 263 | 264 | How to Apply These Terms to Your New Programs 265 | 266 | If you develop a new program, and you want it to be of the greatest possible 267 | use to the public, the best way to achieve this is to make it free software 268 | which everyone can redistribute and change under these terms. 269 | 270 | To do so, attach the following notices to the program. It is safest to attach 271 | them to the start of each source file to most effectively convey the exclusion 272 | of warranty; and each file should have at least the "copyright" line and a 273 | pointer to where the full notice is found. 274 | 275 | One line to give the program's name and a brief idea of what it does. 276 | 277 | Copyright (C) 278 | 279 | This program is free software; you can redistribute it and/or modify it 280 | under the terms of the GNU General Public License as published by the Free 281 | Software Foundation; either version 2 of the License, or (at your option) 282 | any later version. 283 | 284 | This program is distributed in the hope that it will be useful, but WITHOUT 285 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 287 | more details. 288 | 289 | You should have received a copy of the GNU General Public License along 290 | with this program; if not, write to the Free Software Foundation, Inc., 291 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292 | 293 | Also add information on how to contact you by electronic and paper mail. 294 | 295 | If the program is interactive, make it output a short notice like this when it 296 | starts in an interactive mode: 297 | 298 | Gnomovision version 69, Copyright (C) year name of author Gnomovision comes 299 | with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free 300 | software, and you are welcome to redistribute it under certain conditions; 301 | type 'show c' for details. 302 | 303 | The hypothetical commands 'show w' and 'show c' should show the appropriate 304 | parts of the General Public License. Of course, the commands you use may be 305 | called something other than 'show w' and 'show c'; they could even be 306 | mouse-clicks or menu items--whatever suits your program. 307 | 308 | You should also get your employer (if you work as a programmer) or your school, 309 | if any, to sign a "copyright disclaimer" for the program, if necessary. Here 310 | is a sample; alter the names: 311 | 312 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 313 | 'Gnomovision' (which makes passes at compilers) written by James Hacker. 314 | 315 | signature of Ty Coon, 1 April 1989 316 | 317 | Ty Coon, President of Vice 318 | 319 | This General Public License does not permit incorporating your program into 320 | proprietary programs. If your program is a subroutine library, you may 321 | consider it more useful to permit linking proprietary applications with the 322 | library. If this is what you want to do, use the GNU Library General Public 323 | License instead of this License. 324 | 325 | 326 | "CLASSPATH" EXCEPTION TO THE GPL 327 | 328 | Certain source files distributed by Oracle America and/or its affiliates are 329 | subject to the following clarification and special exception to the GPL, but 330 | only where Oracle has expressly included in the particular source file's header 331 | the words "Oracle designates this particular file as subject to the "Classpath" 332 | exception as provided by Oracle in the LICENSE file that accompanied this code." 333 | 334 | Linking this library statically or dynamically with other modules is making 335 | a combined work based on this library. Thus, the terms and conditions of 336 | the GNU General Public License cover the whole combination. 337 | 338 | As a special exception, the copyright holders of this library give you 339 | permission to link this library with independent modules to produce an 340 | executable, regardless of the license terms of these independent modules, 341 | and to copy and distribute the resulting executable under terms of your 342 | choice, provided that you also meet, for each linked independent module, 343 | the terms and conditions of the license of that module. An independent 344 | module is a module which is not derived from or based on this library. If 345 | you modify this library, you may extend this exception to your version of 346 | the library, but you are not obligated to do so. If you do not wish to do 347 | so, delete this exception statement from your version. 348 | -------------------------------------------------------------------------------- /docs/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.5.1 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.5.1 6 | Copyright JS Foundation and other contributors, https://js.foundation/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | ****************************************** 28 | 29 | The jQuery JavaScript Library v3.5.1 also includes Sizzle.js 30 | 31 | Sizzle.js includes the following license: 32 | 33 | Copyright JS Foundation and other contributors, https://js.foundation/ 34 | 35 | This software consists of voluntary contributions made by many 36 | individuals. For exact contribution history, see the revision history 37 | available at https://github.com/jquery/sizzle 38 | 39 | The following license applies to all parts of this software except as 40 | documented below: 41 | 42 | ==== 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining 45 | a copy of this software and associated documentation files (the 46 | "Software"), to deal in the Software without restriction, including 47 | without limitation the rights to use, copy, modify, merge, publish, 48 | distribute, sublicense, and/or sell copies of the Software, and to 49 | permit persons to whom the Software is furnished to do so, subject to 50 | the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be 53 | included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 58 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 59 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 60 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 61 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 62 | 63 | ==== 64 | 65 | All files located in the node_modules and external directories are 66 | externally maintained libraries used by this software which have their 67 | own licenses; we recommend you read them, as their terms may differ from 68 | the terms above. 69 | 70 | ********************* 71 | 72 | ``` 73 | -------------------------------------------------------------------------------- /docs/legal/jqueryUI.md: -------------------------------------------------------------------------------- 1 | ## jQuery UI v1.12.1 2 | 3 | ### jQuery UI License 4 | ``` 5 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 6 | 7 | This software consists of voluntary contributions made by many 8 | individuals. For exact contribution history, see the revision history 9 | available at https://github.com/jquery/jquery-ui 10 | 11 | The following license applies to all parts of this software except as 12 | documented below: 13 | 14 | ==== 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining 17 | a copy of this software and associated documentation files (the 18 | "Software"), to deal in the Software without restriction, including 19 | without limitation the rights to use, copy, modify, merge, publish, 20 | distribute, sublicense, and/or sell copies of the Software, and to 21 | permit persons to whom the Software is furnished to do so, subject to 22 | the following conditions: 23 | 24 | The above copyright notice and this permission notice shall be 25 | included in all copies or substantial portions of the Software. 26 | 27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | ==== 36 | 37 | Copyright and related rights for sample code are waived via CC0. Sample 38 | code is defined as all source code contained within the demos directory. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | All files located in the node_modules and external directories are 45 | externally maintained libraries used by this software which have their 46 | own licenses; we recommend you read them, as their terms may differ from 47 | the terms above. 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /docs/member-search-index.js: -------------------------------------------------------------------------------- 1 | memberSearchIndex = [{"p":"com.diogonunes.jcolor","c":"Ansi","l":"Ansi()","u":"%3Cinit%3E()"},{"p":"com.diogonunes.jcolor","c":"AnsiFormat","l":"AnsiFormat(Attribute...)","u":"%3Cinit%3E(com.diogonunes.jcolor.Attribute...)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"Attribute()","u":"%3Cinit%3E()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BACK_COLOR(int)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BACK_COLOR(int, int, int)","u":"BACK_COLOR(int,int,int)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BLACK_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BLACK_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BLUE_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BLUE_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BOLD()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_BLACK_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_BLACK_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_BLUE_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_BLUE_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_CYAN_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_CYAN_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_GREEN_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_GREEN_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_MAGENTA_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_MAGENTA_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_RED_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_RED_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_WHITE_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_WHITE_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_YELLOW_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"BRIGHT_YELLOW_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Command","l":"CLEAR_SCREEN()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"CLEAR()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"colorize(Command)","u":"colorize(com.diogonunes.jcolor.Command)"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"colorize(String, AnsiFormat)","u":"colorize(java.lang.String,com.diogonunes.jcolor.AnsiFormat)"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"colorize(String, Attribute...)","u":"colorize(java.lang.String,com.diogonunes.jcolor.Attribute...)"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"colorize(String, String)","u":"colorize(java.lang.String,java.lang.String)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"CYAN_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"CYAN_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"DESATURATED()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"DIM()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"ENCIRCLED()"},{"p":"com.diogonunes.jcolor","c":"AnsiFormat","l":"format(String)","u":"format(java.lang.String)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"FRAMED()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"generateCode(AnsiFormat)","u":"generateCode(com.diogonunes.jcolor.AnsiFormat)"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"generateCode(Attribute...)","u":"generateCode(com.diogonunes.jcolor.Attribute...)"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"generateCode(Command)","u":"generateCode(com.diogonunes.jcolor.Command)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"GREEN_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"GREEN_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"HIDDEN()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"ITALIC()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"MAGENTA_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"MAGENTA_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"makeItFabulous(String, Attribute...)","u":"makeItFabulous(java.lang.String,com.diogonunes.jcolor.Attribute...)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"NONE()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"OVERLINED()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"POSTFIX"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"PREFIX"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"RAPID_BLINK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"RED_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"RED_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"RESET"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"REVERSE()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"SATURATED()"},{"p":"com.diogonunes.jcolor","c":"Ansi","l":"SEPARATOR"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"SLOW_BLINK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"STRIKETHROUGH()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"TEXT_COLOR(int)"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"TEXT_COLOR(int, int, int)","u":"TEXT_COLOR(int,int,int)"},{"p":"com.diogonunes.jcolor","c":"AnsiFormat","l":"toArray()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"toString()"},{"p":"com.diogonunes.jcolor","c":"Command","l":"toString()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"UNDERLINE()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"WHITE_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"WHITE_TEXT()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"YELLOW_BACK()"},{"p":"com.diogonunes.jcolor","c":"Attribute","l":"YELLOW_TEXT()"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/module-search-index.js: -------------------------------------------------------------------------------- 1 | moduleSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Class Hierarchy (com.diogonunes:JColor 5.5.2-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 48 |
49 |
50 |
51 |

Hierarchy For All Packages

52 | Package Hierarchies: 53 | 56 |
57 |
58 |

Class Hierarchy

59 |
    60 |
  • java.lang.Object 61 | 67 |
  • 68 |
69 |
70 |
71 |
72 |
73 | 74 |
75 |
76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /docs/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"com.diogonunes.jcolor"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/resources/glass.png -------------------------------------------------------------------------------- /docs/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/resources/x.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_65_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_glass_65_dadada_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dialex/JColor/9c311f01c87f26c07bb1bb9f9cb3bcd6ecd13369/docs/script-dir/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/jquery-ui.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Includes: core.css, autocomplete.css, menu.css, theme.css 4 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=custom-theme&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgImgOpacityContent=75&bgImgOpacityHeader=75&cornerRadiusShadow=8px&offsetLeftShadow=-8px&offsetTopShadow=-8px&thicknessShadow=8px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=%23aaaaaa&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=%23aaaaaa&iconColorError=%23cd0a0a&fcError=%23cd0a0a&borderColorError=%23cd0a0a&bgTextureError=glass&bgColorError=%23fef1ec&iconColorHighlight=%232e83ff&fcHighlight=%23363636&borderColorHighlight=%23fcefa1&bgTextureHighlight=glass&bgColorHighlight=%23fbf9ee&iconColorActive=%23454545&fcActive=%23212121&borderColorActive=%23aaaaaa&bgTextureActive=glass&bgColorActive=%23dadada&iconColorHover=%23454545&fcHover=%23212121&borderColorHover=%23999999&bgTextureHover=glass&bgColorHover=%23dadada&iconColorDefault=%23888888&fcDefault=%23555555&borderColorDefault=%23d3d3d3&bgTextureDefault=glass&bgColorDefault=%23e6e6e6&iconColorContent=%23222222&fcContent=%23222222&borderColorContent=%23aaaaaa&bgTextureContent=flat&bgColorContent=%23ffffff&iconColorHeader=%23222222&fcHeader=%23222222&borderColorHeader=%23aaaaaa&bgTextureHeader=highlight_soft&bgColorHeader=%23cccccc&cornerRadius=4px&fwDefault=normal&fsDefault=1.1em&ffDefault=Verdana%2CArial%2Csans-serif 5 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 6 | 7 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #d3d3d3}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #aaa;background:#dadada url("images/ui-bg_glass_65_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa} -------------------------------------------------------------------------------- /docs/script-dir/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | function loadScripts(doc, tag) { 32 | createElem(doc, tag, 'search.js'); 33 | 34 | createElem(doc, tag, 'module-search-index.js'); 35 | createElem(doc, tag, 'package-search-index.js'); 36 | createElem(doc, tag, 'type-search-index.js'); 37 | createElem(doc, tag, 'member-search-index.js'); 38 | createElem(doc, tag, 'tag-search-index.js'); 39 | } 40 | 41 | function createElem(doc, tag, path) { 42 | var script = doc.createElement(tag); 43 | var scriptElement = doc.getElementsByTagName(tag)[0]; 44 | script.src = pathtoroot + path; 45 | scriptElement.parentNode.insertBefore(script, scriptElement); 46 | } 47 | 48 | function show(tableId, selected, columns) { 49 | if (tableId !== selected) { 50 | document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') 51 | .forEach(function(elem) { 52 | elem.style.display = 'none'; 53 | }); 54 | } 55 | document.querySelectorAll('div.' + selected) 56 | .forEach(function(elem, index) { 57 | elem.style.display = ''; 58 | var isEvenRow = index % (columns * 2) < columns; 59 | elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor); 60 | elem.classList.add(isEvenRow ? evenRowColor : oddRowColor); 61 | }); 62 | updateTabs(tableId, selected); 63 | } 64 | 65 | function updateTabs(tableId, selected) { 66 | document.querySelector('div#' + tableId +' .summary-table') 67 | .setAttribute('aria-labelledby', selected); 68 | document.querySelectorAll('button[id^="' + tableId + '"]') 69 | .forEach(function(tab, index) { 70 | if (selected === tab.id || (tableId === selected && index === 0)) { 71 | tab.className = activeTableTab; 72 | tab.setAttribute('aria-selected', true); 73 | tab.setAttribute('tabindex',0); 74 | } else { 75 | tab.className = tableTab; 76 | tab.setAttribute('aria-selected', false); 77 | tab.setAttribute('tabindex',-1); 78 | } 79 | }); 80 | } 81 | 82 | function switchTab(e) { 83 | var selected = document.querySelector('[aria-selected=true]'); 84 | if (selected) { 85 | if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { 86 | // left or up arrow key pressed: move focus to previous tab 87 | selected.previousSibling.click(); 88 | selected.previousSibling.focus(); 89 | e.preventDefault(); 90 | } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { 91 | // right or down arrow key pressed: move focus to next tab 92 | selected.nextSibling.click(); 93 | selected.nextSibling.focus(); 94 | e.preventDefault(); 95 | } 96 | } 97 | } 98 | 99 | var updateSearchResults = function() {}; 100 | 101 | function indexFilesLoaded() { 102 | return moduleSearchIndex 103 | && packageSearchIndex 104 | && typeSearchIndex 105 | && memberSearchIndex 106 | && tagSearchIndex; 107 | } 108 | 109 | function copySnippet(button) { 110 | var textarea = document.createElement("textarea"); 111 | textarea.style.height = 0; 112 | document.body.appendChild(textarea); 113 | textarea.value = button.nextElementSibling.innerText; 114 | textarea.select(); 115 | document.execCommand("copy"); 116 | document.body.removeChild(textarea); 117 | var span = button.firstElementChild; 118 | var copied = span.getAttribute("data-copied"); 119 | if (span.innerHTML !== copied) { 120 | var initialLabel = span.innerHTML; 121 | span.innerHTML = copied; 122 | var parent = button.parentElement; 123 | parent.onmouseleave = parent.ontouchend = function() { 124 | span.innerHTML = initialLabel; 125 | }; 126 | } 127 | } 128 | 129 | // Workaround for scroll position not being included in browser history (8249133) 130 | document.addEventListener("DOMContentLoaded", function(e) { 131 | var contentDiv = document.querySelector("div.flex-content"); 132 | window.addEventListener("popstate", function(e) { 133 | if (e.state !== null) { 134 | contentDiv.scrollTop = e.state; 135 | } 136 | }); 137 | window.addEventListener("hashchange", function(e) { 138 | history.replaceState(contentDiv.scrollTop, document.title); 139 | }); 140 | contentDiv.addEventListener("scroll", function(e) { 141 | var timeoutID; 142 | if (!timeoutID) { 143 | timeoutID = setTimeout(function() { 144 | history.replaceState(contentDiv.scrollTop, document.title); 145 | timeoutID = null; 146 | }, 100); 147 | } 148 | }); 149 | if (!location.hash) { 150 | history.replaceState(contentDiv.scrollTop, document.title); 151 | } 152 | }); 153 | -------------------------------------------------------------------------------- /docs/search.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | var noResult = {l: "No results found"}; 27 | var loading = {l: "Loading search index..."}; 28 | var catModules = "Modules"; 29 | var catPackages = "Packages"; 30 | var catTypes = "Types"; 31 | var catMembers = "Members"; 32 | var catSearchTags = "Search Tags"; 33 | var highlight = "$&"; 34 | var searchPattern = ""; 35 | var fallbackPattern = ""; 36 | var RANKING_THRESHOLD = 2; 37 | var NO_MATCH = 0xffff; 38 | var MIN_RESULTS = 3; 39 | var MAX_RESULTS = 500; 40 | var UNNAMED = ""; 41 | function escapeHtml(str) { 42 | return str.replace(//g, ">"); 43 | } 44 | function getHighlightedText(item, matcher, fallbackMatcher) { 45 | var escapedItem = escapeHtml(item); 46 | var highlighted = escapedItem.replace(matcher, highlight); 47 | if (highlighted === escapedItem) { 48 | highlighted = escapedItem.replace(fallbackMatcher, highlight) 49 | } 50 | return highlighted; 51 | } 52 | function getURLPrefix(ui) { 53 | var urlPrefix=""; 54 | var slash = "/"; 55 | if (ui.item.category === catModules) { 56 | return ui.item.l + slash; 57 | } else if (ui.item.category === catPackages && ui.item.m) { 58 | return ui.item.m + slash; 59 | } else if (ui.item.category === catTypes || ui.item.category === catMembers) { 60 | if (ui.item.m) { 61 | urlPrefix = ui.item.m + slash; 62 | } else { 63 | $.each(packageSearchIndex, function(index, item) { 64 | if (item.m && ui.item.p === item.l) { 65 | urlPrefix = item.m + slash; 66 | } 67 | }); 68 | } 69 | } 70 | return urlPrefix; 71 | } 72 | function createSearchPattern(term) { 73 | var pattern = ""; 74 | var isWordToken = false; 75 | term.replace(/,\s*/g, ", ").trim().split(/\s+/).forEach(function(w, index) { 76 | if (index > 0) { 77 | // whitespace between identifiers is significant 78 | pattern += (isWordToken && /^\w/.test(w)) ? "\\s+" : "\\s*"; 79 | } 80 | var tokens = w.split(/(?=[A-Z,.()<>[\/])/); 81 | for (var i = 0; i < tokens.length; i++) { 82 | var s = tokens[i]; 83 | if (s === "") { 84 | continue; 85 | } 86 | pattern += $.ui.autocomplete.escapeRegex(s); 87 | isWordToken = /\w$/.test(s); 88 | if (isWordToken) { 89 | pattern += "([a-z0-9_$<>\\[\\]]*?)"; 90 | } 91 | } 92 | }); 93 | return pattern; 94 | } 95 | function createMatcher(pattern, flags) { 96 | var isCamelCase = /[A-Z]/.test(pattern); 97 | return new RegExp(pattern, flags + (isCamelCase ? "" : "i")); 98 | } 99 | $(function() { 100 | var search = $("#search-input"); 101 | var reset = $("#reset-button"); 102 | search.val(''); 103 | search.prop("disabled", false); 104 | reset.prop("disabled", false); 105 | reset.click(function() { 106 | search.val('').focus(); 107 | }); 108 | search.focus(); 109 | }); 110 | $.widget("custom.catcomplete", $.ui.autocomplete, { 111 | _create: function() { 112 | this._super(); 113 | this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); 114 | }, 115 | _renderMenu: function(ul, items) { 116 | var rMenu = this; 117 | var currentCategory = ""; 118 | rMenu.menu.bindings = $(); 119 | $.each(items, function(index, item) { 120 | var li; 121 | if (item.category && item.category !== currentCategory) { 122 | ul.append("
  • " + item.category + "
  • "); 123 | currentCategory = item.category; 124 | } 125 | li = rMenu._renderItemData(ul, item); 126 | if (item.category) { 127 | li.attr("aria-label", item.category + " : " + item.l); 128 | li.attr("class", "result-item"); 129 | } else { 130 | li.attr("aria-label", item.l); 131 | li.attr("class", "result-item"); 132 | } 133 | }); 134 | }, 135 | _renderItem: function(ul, item) { 136 | var label = ""; 137 | var matcher = createMatcher(escapeHtml(searchPattern), "g"); 138 | var fallbackMatcher = new RegExp(fallbackPattern, "gi") 139 | if (item.category === catModules) { 140 | label = getHighlightedText(item.l, matcher, fallbackMatcher); 141 | } else if (item.category === catPackages) { 142 | label = getHighlightedText(item.l, matcher, fallbackMatcher); 143 | } else if (item.category === catTypes) { 144 | label = (item.p && item.p !== UNNAMED) 145 | ? getHighlightedText(item.p + "." + item.l, matcher, fallbackMatcher) 146 | : getHighlightedText(item.l, matcher, fallbackMatcher); 147 | } else if (item.category === catMembers) { 148 | label = (item.p && item.p !== UNNAMED) 149 | ? getHighlightedText(item.p + "." + item.c + "." + item.l, matcher, fallbackMatcher) 150 | : getHighlightedText(item.c + "." + item.l, matcher, fallbackMatcher); 151 | } else if (item.category === catSearchTags) { 152 | label = getHighlightedText(item.l, matcher, fallbackMatcher); 153 | } else { 154 | label = item.l; 155 | } 156 | var li = $("
  • ").appendTo(ul); 157 | var div = $("
    ").appendTo(li); 158 | if (item.category === catSearchTags && item.h) { 159 | if (item.d) { 160 | div.html(label + " (" + item.h + ")
    " 161 | + item.d + "
    "); 162 | } else { 163 | div.html(label + " (" + item.h + ")"); 164 | } 165 | } else { 166 | if (item.m) { 167 | div.html(item.m + "/" + label); 168 | } else { 169 | div.html(label); 170 | } 171 | } 172 | return li; 173 | } 174 | }); 175 | function rankMatch(match, category) { 176 | if (!match) { 177 | return NO_MATCH; 178 | } 179 | var index = match.index; 180 | var input = match.input; 181 | var leftBoundaryMatch = 2; 182 | var periferalMatch = 0; 183 | // make sure match is anchored on a left word boundary 184 | if (index === 0 || /\W/.test(input[index - 1]) || "_" === input[index]) { 185 | leftBoundaryMatch = 0; 186 | } else if ("_" === input[index - 1] || (input[index] === input[index].toUpperCase() && !/^[A-Z0-9_$]+$/.test(input))) { 187 | leftBoundaryMatch = 1; 188 | } 189 | var matchEnd = index + match[0].length; 190 | var leftParen = input.indexOf("("); 191 | var endOfName = leftParen > -1 ? leftParen : input.length; 192 | // exclude peripheral matches 193 | if (category !== catModules && category !== catSearchTags) { 194 | var delim = category === catPackages ? "/" : "."; 195 | if (leftParen > -1 && leftParen < index) { 196 | periferalMatch += 2; 197 | } else if (input.lastIndexOf(delim, endOfName) >= matchEnd) { 198 | periferalMatch += 2; 199 | } 200 | } 201 | var delta = match[0].length === endOfName ? 0 : 1; // rank full match higher than partial match 202 | for (var i = 1; i < match.length; i++) { 203 | // lower ranking if parts of the name are missing 204 | if (match[i]) 205 | delta += match[i].length; 206 | } 207 | if (category === catTypes) { 208 | // lower ranking if a type name contains unmatched camel-case parts 209 | if (/[A-Z]/.test(input.substring(matchEnd))) 210 | delta += 5; 211 | if (/[A-Z]/.test(input.substring(0, index))) 212 | delta += 5; 213 | } 214 | return leftBoundaryMatch + periferalMatch + (delta / 200); 215 | 216 | } 217 | function doSearch(request, response) { 218 | var result = []; 219 | searchPattern = createSearchPattern(request.term); 220 | fallbackPattern = createSearchPattern(request.term.toLowerCase()); 221 | if (searchPattern === "") { 222 | return this.close(); 223 | } 224 | var camelCaseMatcher = createMatcher(searchPattern, ""); 225 | var fallbackMatcher = new RegExp(fallbackPattern, "i"); 226 | 227 | function searchIndexWithMatcher(indexArray, matcher, category, nameFunc) { 228 | if (indexArray) { 229 | var newResults = []; 230 | $.each(indexArray, function (i, item) { 231 | item.category = category; 232 | var ranking = rankMatch(matcher.exec(nameFunc(item)), category); 233 | if (ranking < RANKING_THRESHOLD) { 234 | newResults.push({ranking: ranking, item: item}); 235 | } 236 | return newResults.length <= MAX_RESULTS; 237 | }); 238 | return newResults.sort(function(e1, e2) { 239 | return e1.ranking - e2.ranking; 240 | }).map(function(e) { 241 | return e.item; 242 | }); 243 | } 244 | return []; 245 | } 246 | function searchIndex(indexArray, category, nameFunc) { 247 | var primaryResults = searchIndexWithMatcher(indexArray, camelCaseMatcher, category, nameFunc); 248 | result = result.concat(primaryResults); 249 | if (primaryResults.length <= MIN_RESULTS && !camelCaseMatcher.ignoreCase) { 250 | var secondaryResults = searchIndexWithMatcher(indexArray, fallbackMatcher, category, nameFunc); 251 | result = result.concat(secondaryResults.filter(function (item) { 252 | return primaryResults.indexOf(item) === -1; 253 | })); 254 | } 255 | } 256 | 257 | searchIndex(moduleSearchIndex, catModules, function(item) { return item.l; }); 258 | searchIndex(packageSearchIndex, catPackages, function(item) { 259 | return (item.m && request.term.indexOf("/") > -1) 260 | ? (item.m + "/" + item.l) : item.l; 261 | }); 262 | searchIndex(typeSearchIndex, catTypes, function(item) { 263 | return request.term.indexOf(".") > -1 ? item.p + "." + item.l : item.l; 264 | }); 265 | searchIndex(memberSearchIndex, catMembers, function(item) { 266 | return request.term.indexOf(".") > -1 267 | ? item.p + "." + item.c + "." + item.l : item.l; 268 | }); 269 | searchIndex(tagSearchIndex, catSearchTags, function(item) { return item.l; }); 270 | 271 | if (!indexFilesLoaded()) { 272 | updateSearchResults = function() { 273 | doSearch(request, response); 274 | } 275 | result.unshift(loading); 276 | } else { 277 | updateSearchResults = function() {}; 278 | } 279 | response(result); 280 | } 281 | $(function() { 282 | var expanded = false; 283 | var windowWidth; 284 | function collapse() { 285 | if (expanded) { 286 | $("div#navbar-top").removeAttr("style"); 287 | $("button#navbar-toggle-button") 288 | .removeClass("expanded") 289 | .attr("aria-expanded", "false"); 290 | expanded = false; 291 | } 292 | } 293 | $("button#navbar-toggle-button").click(function (e) { 294 | if (expanded) { 295 | collapse(); 296 | } else { 297 | $("div#navbar-top").height($("#navbar-top").prop("scrollHeight")); 298 | $("button#navbar-toggle-button") 299 | .addClass("expanded") 300 | .attr("aria-expanded", "true"); 301 | expanded = true; 302 | windowWidth = window.innerWidth; 303 | } 304 | }); 305 | $("ul.sub-nav-list-small li a").click(collapse); 306 | $("input#search-input").focus(collapse); 307 | $("main").click(collapse); 308 | $(window).on("orientationchange", collapse).on("resize", function(e) { 309 | if (expanded && windowWidth !== window.innerWidth) collapse(); 310 | }); 311 | $("#search-input").catcomplete({ 312 | minLength: 1, 313 | delay: 300, 314 | source: doSearch, 315 | response: function(event, ui) { 316 | if (!ui.content.length) { 317 | ui.content.push(noResult); 318 | } else { 319 | $("#search-input").empty(); 320 | } 321 | }, 322 | autoFocus: true, 323 | focus: function(event, ui) { 324 | return false; 325 | }, 326 | position: { 327 | collision: "flip" 328 | }, 329 | select: function(event, ui) { 330 | if (ui.item.category) { 331 | var url = getURLPrefix(ui); 332 | if (ui.item.category === catModules) { 333 | url += "module-summary.html"; 334 | } else if (ui.item.category === catPackages) { 335 | if (ui.item.u) { 336 | url = ui.item.u; 337 | } else { 338 | url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; 339 | } 340 | } else if (ui.item.category === catTypes) { 341 | if (ui.item.u) { 342 | url = ui.item.u; 343 | } else if (ui.item.p === UNNAMED) { 344 | url += ui.item.l + ".html"; 345 | } else { 346 | url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; 347 | } 348 | } else if (ui.item.category === catMembers) { 349 | if (ui.item.p === UNNAMED) { 350 | url += ui.item.c + ".html" + "#"; 351 | } else { 352 | url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; 353 | } 354 | if (ui.item.u) { 355 | url += ui.item.u; 356 | } else { 357 | url += ui.item.l; 358 | } 359 | } else if (ui.item.category === catSearchTags) { 360 | url += ui.item.u; 361 | } 362 | if (top !== window) { 363 | parent.classFrame.location = pathtoroot + url; 364 | } else { 365 | window.location.href = pathtoroot + url; 366 | } 367 | $("#search-input").focus(); 368 | } 369 | } 370 | }); 371 | }); 372 | -------------------------------------------------------------------------------- /docs/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"com.diogonunes.jcolor","l":"Ansi"},{"p":"com.diogonunes.jcolor","l":"AnsiFormat"},{"p":"com.diogonunes.jcolor","l":"Attribute"},{"p":"com.diogonunes.jcolor","l":"Command"}];updateSearchResults(); -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.diogonunes 5 | JColor 6 | 5.5.2-SNAPSHOT 7 | bundle 8 | ${project.groupId}:${project.artifactId} 9 | An easy syntax to format your strings with colored fonts and backgrounds. 10 | https://github.com/dialex/JColor 11 | 2011 12 | 13 | 14 | UTF-8 15 | 16 | 1.8 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | MIT License 24 | https://opensource.org/licenses/MIT 25 | repo 26 | 27 | 28 | 29 | 30 | 31 | Diogo Nunes 32 | email@diogonunes.com 33 | https://www.diogonunes.com 34 | 35 | 36 | 37 | 38 | scm:git:git@github.com/dialex/jcolor.git 39 | scm:git:git@github.com:dialex/jcolor.git 40 | git@github.com/dialex/jcolor/tree/main 41 | v5.2.0 42 | 43 | 44 | 45 | 46 | ossrh 47 | https://oss.sonatype.org/content/repositories/snapshots 48 | 49 | 50 | ossrh 51 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-compiler-plugin 60 | 3.10.1 61 | 62 | ${maven.compiler.source} 63 | ${maven.compiler.target} 64 | 65 | 66 | 67 | org.apache.felix 68 | maven-bundle-plugin 69 | 5.1.5 70 | true 71 | 72 | 73 | 74 | com.diogonunes*;version=${project.version} 75 | 76 | 77 | 78 | 79 | 80 | org.sonatype.plugins 81 | nexus-staging-maven-plugin 82 | 1.6.13 83 | true 84 | 85 | ossrh 86 | https://oss.sonatype.org/ 87 | true 88 | 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-source-plugin 93 | 3.2.1 94 | 95 | 96 | attach-sources 97 | 98 | jar-no-fork 99 | 100 | 101 | 102 | 103 | 104 | org.apache.maven.plugins 105 | maven-javadoc-plugin 106 | 3.1.1 107 | 108 | 8 109 | 110 | 111 | 112 | attach-javadocs 113 | 114 | jar 115 | 116 | 117 | 118 | 119 | 120 | org.apache.maven.plugins 121 | maven-gpg-plugin 122 | 1.6 123 | 124 | 125 | sign-artifacts 126 | verify 127 | 128 | sign 129 | 130 | 131 | 70AC2DCF410F446BD81C82D603AEFF59C2E5C034 132 | 133 | 134 | --pinentry-mode 135 | loopback 136 | 137 | 138 | 139 | 140 | 141 | 142 | org.apache.maven.plugins 143 | maven-release-plugin 144 | 2.5.3 145 | 146 | true 147 | false 148 | release 149 | deploy 150 | v@{version} 151 | 152 | 153 | 154 | org.apache.maven.plugins 155 | maven-enforcer-plugin 156 | 3.0.0-M2 157 | 158 | 159 | enforce-maven 160 | 161 | enforce 162 | 163 | 164 | 165 | 166 | 3.2.5 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | org.apache.maven.plugins 175 | maven-surefire-plugin 176 | 2.22.2 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | org.apache.felix 185 | maven-bundle-plugin 186 | 5.1.6 187 | maven-plugin 188 | test 189 | 190 | 191 | 192 | org.hamcrest 193 | hamcrest-library 194 | 2.2 195 | test 196 | 197 | 198 | org.junit.jupiter 199 | junit-jupiter-api 200 | 5.8.2 201 | test 202 | 203 | 204 | org.junit.jupiter 205 | junit-jupiter-engine 206 | 5.8.2 207 | test 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/Ansi.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | /** 4 | * Provides a fluent API to generate 5 | * ANSI escape sequences 6 | * by specifying {@link Attribute}s of your format. 7 | */ 8 | public class Ansi { 9 | 10 | private static final char ESC = 27; // Escape character used to start an ANSI code 11 | private static final String NEWLINE = System.getProperty("line.separator"); 12 | 13 | /** 14 | * Every Ansi escape code begins with this PREFIX. 15 | */ 16 | public static final String PREFIX = ESC + "["; 17 | /** 18 | * Two options must be separated by this SEPARATOR. 19 | */ 20 | public static final String SEPARATOR = ";"; 21 | /** 22 | * Every Ansi escape code must end with this POSTFIX. 23 | */ 24 | public static final String POSTFIX = "m"; 25 | /** 26 | * Shorthand for the Ansi code that resets to the terminal's default format. 27 | */ 28 | public static final String RESET = PREFIX + Attribute.CLEAR() + POSTFIX; 29 | 30 | /** 31 | * @param attributes ANSI attributes to format a text. 32 | * @return The ANSI code that describes all those attributes together. 33 | */ 34 | public static String generateCode(Attribute... attributes) { 35 | StringBuilder builder = new StringBuilder(); 36 | 37 | builder.append(PREFIX); 38 | for (Object option : attributes) { 39 | String code = option.toString(); 40 | if (code.equals("")) 41 | continue; 42 | builder.append(code); 43 | builder.append(SEPARATOR); 44 | } 45 | builder.append(POSTFIX); 46 | 47 | // because code must not end with SEPARATOR 48 | return builder.toString().replace(SEPARATOR + POSTFIX, POSTFIX); 49 | } 50 | 51 | /** 52 | * @param attributes Object containing format attributes. 53 | * @return The ANSI code that describes all those attributes together. 54 | */ 55 | public static String generateCode(AnsiFormat attributes) { 56 | return generateCode(attributes.toArray()); 57 | } 58 | 59 | /** 60 | * @param command ANSI command to apply to terminal. 61 | * @return The ANSI code that describes that command. 62 | */ 63 | public static String generateCode(Command command) { 64 | return PREFIX + command; 65 | } 66 | 67 | /** 68 | * @param command Ansi command to apply to terminal. 69 | * @return The formatted string, ready to be printed. 70 | */ 71 | public static String colorize(Command command) { 72 | return generateCode(command); 73 | } 74 | 75 | /** 76 | * @param text String to format. 77 | * @param ansiCode Ansi code to format each message's lines. 78 | * @return The formatted string, ready to be printed. 79 | */ 80 | public static String colorize(String text, String ansiCode) { 81 | StringBuilder output = new StringBuilder(); 82 | 83 | /* 84 | * Every formatted line should: 85 | * 1) start with a code that sets the format 86 | * 2) end with a code that resets the format 87 | * This prevents "spilling" the format to other independent prints, which 88 | * is noticeable when the background is colored. 89 | */ 90 | 91 | output.append(ansiCode); 92 | // Each line needs to end the current format (RESET) and start it on the next line. 93 | // This avoids spilling, ie. a long line without text but formatted background 94 | String enclosedFormatting = text.replace(NEWLINE, RESET + NEWLINE + ansiCode); 95 | output.append(enclosedFormatting); 96 | output.append(RESET); 97 | return output.toString(); 98 | } 99 | 100 | /** 101 | * @param text String to format. 102 | * @param attributes ANSI attributes to format a text. 103 | * @return The formatted string, ready to be printed. 104 | */ 105 | public static String colorize(String text, Attribute... attributes) { 106 | String ansiCode = generateCode(attributes); 107 | return colorize(text, ansiCode); 108 | } 109 | 110 | /** 111 | * @param text String to format. 112 | * @param attributes Object containing format attributes. 113 | * @return The formatted string, ready to be printed. 114 | */ 115 | public static String colorize(String text, AnsiFormat attributes) { 116 | return colorize(text, attributes.toArray()); 117 | } 118 | 119 | /** 120 | * Easter egg. Just an alias of method "colorize". 121 | * 122 | * @param text String to format. 123 | * @param attributes ANSI attributes to format a text. 124 | * @return The formatted string, ready to be printed. 125 | */ 126 | public static String makeItFabulous(String text, Attribute... attributes) { 127 | return colorize(text, attributes); 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/AnsiFormat.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | 6 | /** 7 | * Abstracts an Array of {@link Attribute}s. 8 | * Use it if you find this more readable than Attribute[]. 9 | */ 10 | public class AnsiFormat { 11 | 12 | // Starts with capacity=2 because that's how many attributes are used on average 13 | private final ArrayList _attributes = new ArrayList<>(2); 14 | 15 | /** 16 | * @param attributes All ANSI attributes to format a text. 17 | */ 18 | public AnsiFormat(Attribute... attributes) { 19 | _attributes.addAll(Arrays.asList(attributes)); 20 | } 21 | 22 | /** 23 | * @param text String to format. 24 | * @return The formatted string, ready to be printed. 25 | */ 26 | public String format(String text) { 27 | return Ansi.colorize(text, this.toArray()); 28 | } 29 | 30 | protected Attribute[] toArray() { 31 | return _attributes.toArray(new Attribute[0]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/Attribute.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | /** 4 | * Abstracts ANSI codes with intuitive names. It maps a description (e.g. RED_TEXT) with a code (e.g. 31). 5 | * @see Wikipedia, for a list of all codes available 6 | * @see StackOverflow, for a list of codes with examples 7 | */ 8 | public abstract class Attribute { 9 | 10 | /** 11 | * @return The Attribute's ansi escape code. 12 | */ 13 | @Override 14 | public abstract String toString(); 15 | 16 | // Effects 17 | 18 | public static Attribute NONE() { 19 | return new SimpleAttribute(""); 20 | } 21 | 22 | /** 23 | * @return Clears any format. Restores the terminal's default format. 24 | */ 25 | public static Attribute CLEAR() { 26 | return new SimpleAttribute("0"); 27 | } 28 | 29 | public static Attribute BOLD() { 30 | return new SimpleAttribute("1"); 31 | } 32 | 33 | /** 34 | * @return Alias of BOLD(). 35 | */ 36 | public static Attribute SATURATED() { 37 | return new SimpleAttribute("1"); 38 | } 39 | 40 | public static Attribute DIM() { 41 | return new SimpleAttribute("2"); 42 | } 43 | 44 | /** 45 | * @return Alias of DIM(). 46 | */ 47 | public static Attribute DESATURATED() { 48 | return new SimpleAttribute("2"); 49 | } 50 | 51 | public static Attribute ITALIC() { 52 | return new SimpleAttribute("3"); 53 | } 54 | 55 | public static Attribute UNDERLINE() { 56 | return new SimpleAttribute("4"); 57 | } 58 | 59 | public static Attribute SLOW_BLINK() { 60 | return new SimpleAttribute("5"); 61 | } 62 | 63 | public static Attribute RAPID_BLINK() { 64 | return new SimpleAttribute("6"); 65 | } 66 | 67 | public static Attribute REVERSE() { 68 | return new SimpleAttribute("7"); 69 | } 70 | 71 | public static Attribute HIDDEN() { 72 | return new SimpleAttribute("8"); 73 | } 74 | 75 | public static Attribute STRIKETHROUGH() { 76 | return new SimpleAttribute("9"); 77 | } 78 | 79 | public static Attribute FRAMED() { 80 | return new SimpleAttribute("51"); 81 | } 82 | 83 | public static Attribute ENCIRCLED() { 84 | return new SimpleAttribute("52"); 85 | } 86 | 87 | public static Attribute OVERLINED() { 88 | return new SimpleAttribute("53"); 89 | } 90 | 91 | // Colors (foreground) 92 | 93 | public static Attribute BLACK_TEXT() { 94 | return new SimpleAttribute("30"); 95 | } 96 | 97 | public static Attribute RED_TEXT() { 98 | return new SimpleAttribute("31"); 99 | } 100 | 101 | public static Attribute GREEN_TEXT() { 102 | return new SimpleAttribute("32"); 103 | } 104 | 105 | public static Attribute YELLOW_TEXT() { 106 | return new SimpleAttribute("33"); 107 | } 108 | 109 | public static Attribute BLUE_TEXT() { 110 | return new SimpleAttribute("34"); 111 | } 112 | 113 | public static Attribute MAGENTA_TEXT() { 114 | return new SimpleAttribute("35"); 115 | } 116 | 117 | public static Attribute CYAN_TEXT() { 118 | return new SimpleAttribute("36"); 119 | } 120 | 121 | public static Attribute WHITE_TEXT() { 122 | return new SimpleAttribute("37"); 123 | } 124 | 125 | // Colors (background) 126 | 127 | public static Attribute BLACK_BACK() { 128 | return new SimpleAttribute("40"); 129 | } 130 | 131 | public static Attribute RED_BACK() { 132 | return new SimpleAttribute("41"); 133 | } 134 | 135 | public static Attribute GREEN_BACK() { 136 | return new SimpleAttribute("42"); 137 | } 138 | 139 | public static Attribute YELLOW_BACK() { 140 | return new SimpleAttribute("43"); 141 | } 142 | 143 | public static Attribute BLUE_BACK() { 144 | return new SimpleAttribute("44"); 145 | } 146 | 147 | public static Attribute MAGENTA_BACK() { 148 | return new SimpleAttribute("45"); 149 | } 150 | 151 | public static Attribute CYAN_BACK() { 152 | return new SimpleAttribute("46"); 153 | } 154 | 155 | public static Attribute WHITE_BACK() { 156 | return new SimpleAttribute("47"); 157 | } 158 | 159 | // Bright colors (foreground) 160 | 161 | public static Attribute BRIGHT_BLACK_TEXT() { 162 | return new SimpleAttribute("90"); 163 | } 164 | 165 | public static Attribute BRIGHT_RED_TEXT() { 166 | return new SimpleAttribute("91"); 167 | } 168 | 169 | public static Attribute BRIGHT_GREEN_TEXT() { 170 | return new SimpleAttribute("92"); 171 | } 172 | 173 | public static Attribute BRIGHT_YELLOW_TEXT() { 174 | return new SimpleAttribute("93"); 175 | } 176 | 177 | public static Attribute BRIGHT_BLUE_TEXT() { 178 | return new SimpleAttribute("94"); 179 | } 180 | 181 | public static Attribute BRIGHT_MAGENTA_TEXT() { 182 | return new SimpleAttribute("95"); 183 | } 184 | 185 | public static Attribute BRIGHT_CYAN_TEXT() { 186 | return new SimpleAttribute("96"); 187 | } 188 | 189 | public static Attribute BRIGHT_WHITE_TEXT() { 190 | return new SimpleAttribute("97"); 191 | } 192 | 193 | // Bright colors (background) 194 | 195 | public static Attribute BRIGHT_BLACK_BACK() { 196 | return new SimpleAttribute("100"); 197 | } 198 | 199 | public static Attribute BRIGHT_RED_BACK() { 200 | return new SimpleAttribute("101"); 201 | } 202 | 203 | public static Attribute BRIGHT_GREEN_BACK() { 204 | return new SimpleAttribute("102"); 205 | } 206 | 207 | public static Attribute BRIGHT_YELLOW_BACK() { 208 | return new SimpleAttribute("103"); 209 | } 210 | 211 | public static Attribute BRIGHT_BLUE_BACK() { 212 | return new SimpleAttribute("104"); 213 | } 214 | 215 | public static Attribute BRIGHT_MAGENTA_BACK() { 216 | return new SimpleAttribute("105"); 217 | } 218 | 219 | public static Attribute BRIGHT_CYAN_BACK() { 220 | return new SimpleAttribute("106"); 221 | } 222 | 223 | public static Attribute BRIGHT_WHITE_BACK() { 224 | return new SimpleAttribute("107"); 225 | } 226 | 227 | // Complex colors 228 | 229 | /** 230 | * 231 | * @param colorNumber A number (0-255) that represents an 8-bit color. 232 | * @return An Attribute that represents a foreground with an 8-bit color. 233 | */ 234 | public static Attribute TEXT_COLOR(int colorNumber) { 235 | return new TextColorAttribute(colorNumber); 236 | } 237 | 238 | /** 239 | * 240 | * @param r A number (0-255) that represents the red component. 241 | * @param g A number (0-255) that represents the green component. 242 | * @param b A number (0-255) that represents the blue component. 243 | * @return An Attribute that represents a foreground with a true color. 244 | */ 245 | public static Attribute TEXT_COLOR(int r, int g, int b) { 246 | return new TextColorAttribute(r, g, b); 247 | } 248 | 249 | /** 250 | * 251 | * @param colorNumber A number (0-255) that represents an 8-bit color. 252 | * @return An Attribute that represents a background with an 8-bit color. 253 | */ 254 | public static Attribute BACK_COLOR(int colorNumber) { 255 | return new BackColorAttribute(colorNumber); 256 | } 257 | 258 | /** 259 | * 260 | * @param r A number (0-255) that represents the red component. 261 | * @param g A number (0-255) that represents the green component. 262 | * @param b A number (0-255) that represents the blue component. 263 | * @return An Attribute that represents a background with a true color. 264 | */ 265 | public static Attribute BACK_COLOR(int r, int g, int b) { 266 | return new BackColorAttribute(r, g, b); 267 | } 268 | } 269 | 270 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/BackColorAttribute.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | class BackColorAttribute extends ColorAttribute { 4 | 5 | /** 6 | * {@inheritDoc} 7 | */ 8 | BackColorAttribute(int colorNumber) { 9 | super(colorNumber); 10 | } 11 | 12 | /** 13 | * {@inheritDoc} 14 | */ 15 | BackColorAttribute(int r, int g, int b) { 16 | super(r, g, b); 17 | } 18 | 19 | @Override 20 | protected String getColorAnsiPrefix() { 21 | String ANSI_8BIT_COLOR_PREFIX = "48;5;"; 22 | String ANSI_TRUE_COLOR_PREFIX = "48;2;"; 23 | 24 | return isTrueColor() ? ANSI_TRUE_COLOR_PREFIX : ANSI_8BIT_COLOR_PREFIX; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/ColorAttribute.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | import static java.lang.String.valueOf; 4 | 5 | abstract class ColorAttribute extends Attribute { 6 | 7 | protected final String[] _color; 8 | 9 | /** 10 | * Constructor (8-bit color). 11 | * 12 | * @param colorNumber A number (0-255) that represents an 8-bit color. 13 | */ 14 | ColorAttribute(int colorNumber) { 15 | if (0 <= colorNumber && colorNumber <= 255) { 16 | _color = new String[]{valueOf(colorNumber)}; 17 | } else 18 | throw new IllegalArgumentException("Color must be a number inside range [0-255]. Received: " + colorNumber); 19 | } 20 | 21 | /** 22 | * Constructor (true-color). 23 | * 24 | * @param r A number (0-255) that represents the red component. 25 | * @param g A number (0-255) that represents the green component. 26 | * @param b A number (0-255) that represents the blue component. 27 | */ 28 | ColorAttribute(int r, int g, int b) { 29 | if ((0 <= r && r <= 255) && (0 <= g && g <= 255) && (0 <= b && b <= 255)) { 30 | _color = new String[]{valueOf(r), valueOf(g), valueOf(b)}; 31 | } else 32 | throw new IllegalArgumentException( 33 | String.format("Color components must be a number inside range [0-255]. Received: %d, %d, %d", r, g, b)); 34 | } 35 | 36 | protected boolean isTrueColor() { 37 | return (_color.length == 3 ); 38 | } 39 | 40 | protected abstract String getColorAnsiPrefix(); 41 | 42 | protected String getColorAnsiCode() { 43 | if (isTrueColor()) 44 | return _color[0] + Ansi.SEPARATOR + _color[1] + Ansi.SEPARATOR + _color[2]; 45 | else 46 | return _color[0]; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return getColorAnsiPrefix() + getColorAnsiCode(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/Command.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | /** 4 | * Abstracts ANSI codes with intuitive names. It maps a command (e.g. CLEAR_SCREEN) with a code. 5 | */ 6 | public class Command { 7 | 8 | private final String _code; 9 | 10 | /** 11 | * Constructor. Maps a command to an Ansi code. 12 | * 13 | * @param code Ansi code that represents the command. 14 | */ 15 | Command(String code) { 16 | _code = code; 17 | } 18 | 19 | /** 20 | * @return Clears the terminal's text, e.g. just like the command-line `clear`. 21 | */ 22 | public static Command CLEAR_SCREEN() { 23 | // Covers https://github.com/dialex/JColor/issues/68 24 | return new Command("H\\033[2J\""); 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return _code; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/SimpleAttribute.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | class SimpleAttribute extends Attribute { 4 | 5 | private final String _code; 6 | 7 | /** 8 | * Constructor. Maps an attribute to an Ansi code. 9 | * 10 | * @param code Ansi code that represents the attribute. 11 | */ 12 | SimpleAttribute(String code) { 13 | _code = code; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return _code; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/diogonunes/jcolor/TextColorAttribute.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor; 2 | 3 | class TextColorAttribute extends ColorAttribute { 4 | 5 | /** 6 | * {@inheritDoc} 7 | */ 8 | TextColorAttribute(int colorNumber) { 9 | super(colorNumber); 10 | } 11 | 12 | /** 13 | * {@inheritDoc} 14 | */ 15 | TextColorAttribute(int r, int g, int b) { 16 | super(r, g, b); 17 | } 18 | 19 | @Override 20 | protected String getColorAnsiPrefix() { 21 | String ANSI_8BIT_COLOR_PREFIX = "38;5;"; 22 | String ANSI_TRUE_COLOR_PREFIX = "38;2;"; 23 | 24 | return isTrueColor() ? ANSI_TRUE_COLOR_PREFIX : ANSI_8BIT_COLOR_PREFIX; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/acceptance/TestHumanEye.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.acceptance; 2 | 3 | import com.diogonunes.jcolor.AnsiFormat; 4 | import com.diogonunes.jcolor.Attribute; 5 | import org.junit.jupiter.api.Disabled; 6 | 7 | import static com.diogonunes.jcolor.Ansi.colorize; 8 | import static com.diogonunes.jcolor.Attribute.*; 9 | import static com.diogonunes.jcolor.tests.unit.DataGenerator.randomInt; 10 | 11 | public class TestHumanEye { 12 | 13 | @Disabled 14 | public void ShouldLookGood() { 15 | 16 | /* 17 | ============== 18 | Usage examples 19 | ============== 20 | */ 21 | 22 | // Use Case 1: use Ansi.colorize() to format inline 23 | System.out.println(colorize("This text will be yellow on magenta", YELLOW_TEXT(), MAGENTA_BACK())); 24 | System.out.println("\n"); 25 | 26 | // Use Case 2: compose Attributes to create your desired format 27 | Attribute[] myFormat = new Attribute[]{RED_TEXT(), YELLOW_BACK(), BOLD()}; 28 | System.out.println(colorize("This text will be red on yellow", myFormat)); 29 | System.out.println("\n"); 30 | 31 | // Use Case 3: AnsiFormat is syntactic sugar for an array of Attributes 32 | AnsiFormat fWarning = new AnsiFormat(GREEN_TEXT(), BLUE_BACK(), BOLD()); 33 | System.out.println(colorize("AnsiFormat is just a pretty way to declare formats", fWarning)); 34 | System.out.println(fWarning.format("...and use those formats without calling colorize() directly")); 35 | System.out.println("\n"); 36 | 37 | // Use Case 4: you can define your formats and use them throughout your code 38 | AnsiFormat fInfo = new AnsiFormat(CYAN_TEXT()); 39 | AnsiFormat fError = new AnsiFormat(YELLOW_TEXT(), RED_BACK()); 40 | System.out.println(fInfo.format("This info message will be cyan")); 41 | System.out.println("This normal message will not be formatted"); 42 | System.out.println(fError.format("This error message will be yellow on red")); 43 | System.out.println("\n"); 44 | 45 | // Use Case 5: we support bright colors 46 | AnsiFormat fNormal = new AnsiFormat(MAGENTA_BACK(), YELLOW_TEXT()); 47 | AnsiFormat fBright = new AnsiFormat(BRIGHT_MAGENTA_BACK(), BRIGHT_YELLOW_TEXT()); 48 | System.out.println(fNormal.format("You can use normal colors ") + fBright.format(" and bright colors too")); 49 | 50 | // Use Case 6: we support 8-bit colors 51 | System.out.println("Any 8-bit color (0-255), as long as your terminal supports it:"); 52 | for (int i = 0; i <= 255; i++) { 53 | Attribute textColor = TEXT_COLOR(i); 54 | System.out.print(colorize(String.format("%4d", i), textColor)); 55 | } 56 | System.out.println("\n"); 57 | 58 | // Use Case 7: we support true colors (RGB) 59 | System.out.println("Any TrueColor (RGB), as long as your terminal supports it:"); 60 | for (int i = 0; i <= 300; i++) { 61 | Attribute bkgColor = BACK_COLOR(randomInt(255), randomInt(255), randomInt(255)); 62 | System.out.print(colorize(" ", bkgColor)); 63 | } 64 | System.out.println("\n"); 65 | 66 | // Credits 67 | System.out.print("This example used JColor 5.1.0 "); 68 | System.out.print(colorize("\tMADE ", BOLD(), BRIGHT_YELLOW_TEXT(), GREEN_BACK())); 69 | System.out.println(colorize("IN PORTUGAL\t", BOLD(), BRIGHT_YELLOW_TEXT(), RED_BACK())); 70 | System.out.println("I hope you find it useful ;)"); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/unit/DataGenerator.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.unit; 2 | 3 | import java.util.Random; 4 | import java.util.regex.Matcher; 5 | import java.util.regex.Pattern; 6 | 7 | public class DataGenerator { 8 | 9 | public static final String NEWLINE = System.getProperty("line.separator"); 10 | private static final Random _rand = new Random(); 11 | 12 | public static String createText() { 13 | return "Message"; 14 | } 15 | 16 | public static String createTextWithId(int n) { 17 | return "Message" + n; 18 | } 19 | 20 | public static String createTextLine() { 21 | return "This is a line" + NEWLINE; 22 | } 23 | 24 | public static int randomInt(int upperLimit) { 25 | return _rand.nextInt(upperLimit); 26 | } 27 | 28 | // Adapted from https://stackoverflow.com/a/2850495/675577 29 | public static int countLines(String text) { 30 | Matcher m = Pattern.compile(NEWLINE).matcher(text); 31 | int lines = 0; 32 | while (m.find()) 33 | lines++; 34 | return lines; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/unit/TestAnsi.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.unit; 2 | 3 | import com.diogonunes.jcolor.Ansi; 4 | import com.diogonunes.jcolor.AnsiFormat; 5 | import com.diogonunes.jcolor.Attribute; 6 | import com.diogonunes.jcolor.Command; 7 | import org.junit.jupiter.api.Test; 8 | 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | import static com.diogonunes.jcolor.Ansi.*; 13 | import static com.diogonunes.jcolor.Attribute.*; 14 | import static com.diogonunes.jcolor.tests.unit.DataGenerator.*; 15 | import static org.hamcrest.MatcherAssert.assertThat; 16 | import static org.hamcrest.Matchers.*; 17 | 18 | /** 19 | * Tests for Ansi class. 20 | */ 21 | public class TestAnsi { 22 | 23 | public static final String NEWLINE = System.getProperty("line.separator"); 24 | 25 | @Test 26 | public void Configuration_EscapeCodes() { 27 | // ARRANGE 28 | 29 | // ACT 30 | 31 | // ASSERT 32 | char escapeChar = 27; // according to spec: https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences 33 | assertThat(PREFIX, equalTo(escapeChar + "[")); 34 | assertThat(POSTFIX, equalTo("m")); 35 | assertThat(SEPARATOR, equalTo(";")); 36 | } 37 | 38 | @Test 39 | public void GenerateCode_ZeroAttributes() { 40 | // ARRANGE 41 | Attribute[] attributes = new Attribute[]{}; 42 | 43 | // ACT 44 | String code = Ansi.generateCode(attributes); 45 | 46 | // ASSERT 47 | String expectedCode = PREFIX + POSTFIX; 48 | assertThat(code, equalTo(expectedCode)); 49 | } 50 | 51 | @Test // Covers https://github.com/dialex/JColor/issues/56 52 | public void GenerateCode_OneCommand() { 53 | // ARRANGE 54 | Command command = Command.CLEAR_SCREEN(); 55 | 56 | // ACT 57 | String code = Ansi.generateCode(command); 58 | 59 | // ASSERT 60 | String expectedCode = PREFIX + command; 61 | assertThat(code, equalTo(expectedCode)); 62 | } 63 | 64 | @Test // Covers https://github.com/dialex/JColor/issues/68 65 | public void GenerateCode_ComplexCommand() { 66 | // ARRANGE 67 | int totalCommands = 0; 68 | Command command = Command.CLEAR_SCREEN(); 69 | 70 | // ACT 71 | String code = generateCode(command); 72 | 73 | // ASSERT 74 | Matcher prefix = (Pattern.compile("\\[")).matcher(code); 75 | while (prefix.find()) 76 | totalCommands++; 77 | assertThat(totalCommands, equalTo(2)); 78 | } 79 | 80 | @Test // Covers https://github.com/dialex/JColor/issues/6 81 | public void GenerateCode_OneAttribute_Simple() { 82 | // ARRANGE 83 | Attribute[] attributes = new Attribute[]{STRIKETHROUGH()}; 84 | 85 | // ACT 86 | String code = Ansi.generateCode(attributes); 87 | 88 | // ASSERT 89 | String expectedCode = PREFIX + attributes[0] + POSTFIX; 90 | assertThat(code, equalTo(expectedCode)); 91 | } 92 | 93 | @Test 94 | public void GenerateCode_OneAttribute_Color() { 95 | // ARRANGE 96 | Attribute[] attributes = new Attribute[]{TEXT_COLOR(225)}; 97 | 98 | // ACT 99 | String code = Ansi.generateCode(attributes); 100 | 101 | // ASSERT 102 | String expectedCode = PREFIX + attributes[0] + POSTFIX; 103 | assertThat(code, equalTo(expectedCode)); 104 | } 105 | 106 | @Test 107 | public void GenerateCode_MultipleAttributes_HandlesArray() { 108 | // ARRANGE 109 | Attribute[] attributes = new Attribute[]{DIM(), CYAN_TEXT()}; 110 | 111 | // ACT 112 | String code = Ansi.generateCode(attributes); 113 | 114 | // ASSERT 115 | String expectedCode = PREFIX + attributes[0] + SEPARATOR + attributes[1] + POSTFIX; 116 | assertThat(code, equalTo(expectedCode)); 117 | } 118 | 119 | @Test 120 | public void GenerateCode_MultipleAttributes_HandlesAnsiFormat() { 121 | // ARRANGE 122 | AnsiFormat attributes = new AnsiFormat(DIM(), CYAN_TEXT()); 123 | 124 | // ACT 125 | String code = Ansi.generateCode(attributes); 126 | 127 | // ASSERT 128 | String expectedCode = PREFIX + DIM() + SEPARATOR + CYAN_TEXT() + POSTFIX; 129 | assertThat(code, equalTo(expectedCode)); 130 | } 131 | 132 | @Test 133 | public void GenerateCode_MultipleAttributes_HandlesMultipleParams() { 134 | // ARRANGE 135 | Attribute firstAttribute = UNDERLINE(); 136 | Attribute secondAttribute = GREEN_TEXT(); 137 | 138 | // ACT 139 | String code = Ansi.generateCode(firstAttribute, secondAttribute); 140 | 141 | // ASSERT 142 | String expectedCode = PREFIX + firstAttribute + SEPARATOR + secondAttribute + POSTFIX; 143 | assertThat(code, equalTo(expectedCode)); 144 | } 145 | 146 | @Test 147 | public void GenerateCode_MultipleAttributes_HandlesAttributesWithoutCode() { 148 | // ARRANGE 149 | Attribute[] attributes = new Attribute[]{NONE(), NONE(), NONE()}; 150 | 151 | // ACT 152 | String code = Ansi.generateCode(attributes); 153 | 154 | // ASSERT 155 | String expectedCode = PREFIX + POSTFIX; 156 | assertThat(code, equalTo(expectedCode)); 157 | } 158 | 159 | @Test // Covers https://github.com/dialex/JColor/issues/6 160 | public void GenerateCode_MultiplesAttributes_HandlesAttributesMixedWithNone() { 161 | // ARRANGE 162 | Attribute[] attributes = new Attribute[]{NONE(), BLUE_TEXT(), NONE()}; 163 | 164 | // ACT 165 | String code = Ansi.generateCode(attributes); 166 | 167 | // ASSERT 168 | String expectedCode = PREFIX + attributes[1] + POSTFIX; 169 | assertThat(code, equalTo(expectedCode)); 170 | int suffixIndex = code.lastIndexOf(POSTFIX); 171 | assertThat("Code ending in semicolon does not show color", code.charAt(suffixIndex - 1), is(not(';'))); 172 | } 173 | 174 | @Test 175 | public void Colorize_TextWithoutLines() { 176 | // ARRANGE 177 | Attribute[] attributes = new Attribute[]{YELLOW_BACK()}; 178 | String text = createText(); 179 | 180 | // ACT 181 | String formattedText = Ansi.colorize(text, attributes); 182 | //System.out.println(formattedText); 183 | 184 | // ASSERT 185 | String expectedCode = Ansi.generateCode(attributes); 186 | assertThat(formattedText, startsWith(expectedCode)); 187 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 188 | } 189 | 190 | @Test // Covers https://github.com/dialex/JColor/issues/56 191 | public void Colorize_SingleCommand() { 192 | // ARRANGE 193 | Command command = Command.CLEAR_SCREEN(); 194 | String text = createTextLine(); 195 | 196 | // ACT 197 | String formattedCommand = Ansi.colorize(command); 198 | //System.out.println(formattedText); 199 | 200 | // ASSERT 201 | String expectedCode = Ansi.generateCode(command); 202 | assertThat(formattedCommand, equalTo(expectedCode)); 203 | } 204 | 205 | @Test // Covers https://github.com/dialex/JColor/issues/38 206 | public void Colorize_TextWithSingleLine() { 207 | // ARRANGE 208 | Attribute[] attributes = new Attribute[]{GREEN_BACK()}; 209 | String text = createTextLine(); 210 | 211 | // ACT 212 | String formattedText = Ansi.colorize(text, attributes); 213 | //System.out.println(formattedText); 214 | 215 | // ASSERT 216 | String expectedCode = Ansi.generateCode(attributes); 217 | assertThat("Format must be cleared before changing line, to avoid format spillage", 218 | formattedText, endsWith(Ansi.RESET)); 219 | } 220 | 221 | @Test // Covers https://github.com/dialex/JColor/issues/38 222 | public void Colorize_TextWithMultiplesLines() { 223 | // ARRANGE 224 | Attribute[] attributes = new Attribute[]{RED_BACK()}; 225 | String text1 = createTextWithId(1), text2 = createTextWithId(2); 226 | String fullText = text1 + NEWLINE + text2 + NEWLINE; 227 | 228 | // ACT 229 | String formattedText = Ansi.colorize(fullText, attributes); 230 | //System.out.println(formattedText); 231 | 232 | // ASSERT 233 | String expectedCode = Ansi.generateCode(attributes); 234 | assertThat("Middle lines preserve format", formattedText, containsString(expectedCode + text2 + Ansi.RESET)); 235 | assertThat(formattedText, endsWith(Ansi.RESET)); 236 | } 237 | 238 | @Test // Covers https://github.com/dialex/JColor/issues/51 239 | public void Colorize_TextWithMultipleEmptyLines() { 240 | // ARRANGE 241 | Attribute[] attributes = new Attribute[]{(CYAN_BACK())}; 242 | String emptyLines = NEWLINE + NEWLINE + NEWLINE; 243 | String fullText = createText() + emptyLines; 244 | 245 | // ACT 246 | String formattedText = Ansi.colorize(fullText, attributes); 247 | //System.out.println(formattedText); 248 | 249 | // ASSERT 250 | 251 | assertThat("Empty lines are not deleted", countLines(formattedText), equalTo(countLines(emptyLines))); 252 | assertThat(formattedText, endsWith(Ansi.RESET)); 253 | } 254 | 255 | @Test // Covers https://github.com/dialex/JColor/issues/51 256 | public void Colorize_TextWithMiddleEmptyLines() { 257 | // ARRANGE 258 | Attribute[] attributes = new Attribute[]{(CYAN_BACK())}; 259 | String text1 = createTextWithId(1), text2 = createTextWithId(2); 260 | String fullText = text1 + NEWLINE + NEWLINE + text2; 261 | 262 | // ACT 263 | String formattedText = Ansi.colorize(fullText, attributes); 264 | System.out.println(formattedText); 265 | 266 | // ASSERT 267 | assertThat("Middle empty lines are not deleted", countLines(formattedText), equalTo(countLines(fullText))); 268 | assertThat(formattedText, endsWith(Ansi.RESET)); 269 | } 270 | 271 | @Test 272 | public void Colorize_ConflictingAttributes_UsesTheLast() { 273 | // ARRANGE 274 | Attribute[] attributes = new Attribute[]{BLACK_BACK(), WHITE_BACK(), BLUE_BACK()}; 275 | String text = "This text will have a blue back"; 276 | 277 | // ACT 278 | String formattedText = Ansi.colorize(text, attributes); 279 | //System.out.println(formattedText); 280 | 281 | // ASSERT 282 | String expectedCode = Ansi.generateCode(attributes); 283 | assertThat(formattedText, startsWith(expectedCode)); 284 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/unit/TestCommand.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.unit; 2 | 3 | import com.diogonunes.jcolor.Command; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.hamcrest.MatcherAssert.assertThat; 7 | import static org.hamcrest.Matchers.equalTo; 8 | 9 | /** 10 | * Assert that each Command outputs the correct Ansi code. 11 | */ 12 | public class TestCommand { 13 | 14 | @Test 15 | public void Attribute_AnsiCode_ClearScreen() { 16 | // ARRANGE 17 | Command command = Command.CLEAR_SCREEN(); 18 | 19 | // ACT 20 | String code = command.toString(); 21 | 22 | // ASSERT 23 | String expectedAnsiCode = "H\\033[2J\""; 24 | assertThat(code, equalTo(expectedAnsiCode)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/unit/TestDataGenerator.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.unit; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static com.diogonunes.jcolor.tests.unit.DataGenerator.NEWLINE; 6 | import static com.diogonunes.jcolor.tests.unit.DataGenerator.countLines; 7 | import static org.hamcrest.MatcherAssert.assertThat; 8 | import static org.hamcrest.Matchers.equalTo; 9 | 10 | public class TestDataGenerator { 11 | 12 | @Test 13 | public void CountLines_NoText() { 14 | String text = ""; 15 | assertThat(countLines(text), equalTo(0)); 16 | } 17 | 18 | @Test 19 | public void CountLines_Inline() { 20 | String text = "A sentence without a newline"; 21 | assertThat(countLines(text), equalTo(0)); 22 | } 23 | 24 | @Test 25 | public void CountLines_OneLine() { 26 | String text = "A single line" + NEWLINE; 27 | assertThat(countLines(text), equalTo(1)); 28 | } 29 | 30 | @Test 31 | public void CountLines_MultipleEmptyLines() { 32 | String text = "A single line" + NEWLINE + NEWLINE + NEWLINE; 33 | assertThat(countLines(text), equalTo(3)); 34 | } 35 | 36 | @Test 37 | public void CountLines_MultipleMiddleLines() { 38 | String text = "Preface" + NEWLINE + NEWLINE + "Body" + NEWLINE + "Ending"; 39 | assertThat(countLines(text), equalTo(3)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/diogonunes/jcolor/tests/unit/TestUsage.java: -------------------------------------------------------------------------------- 1 | package com.diogonunes.jcolor.tests.unit; 2 | 3 | import com.diogonunes.jcolor.Ansi; 4 | import com.diogonunes.jcolor.AnsiFormat; 5 | import com.diogonunes.jcolor.Attribute; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import static com.diogonunes.jcolor.Ansi.*; 9 | import static com.diogonunes.jcolor.Attribute.*; 10 | import static org.hamcrest.MatcherAssert.assertThat; 11 | import static org.hamcrest.Matchers.*; 12 | 13 | public class TestUsage { 14 | 15 | @Test 16 | public void CanFormatWithOneAttribute() { 17 | // ARRANGE 18 | AnsiFormat fInfo = new AnsiFormat(CYAN_BACK()); 19 | 20 | // ACT 21 | String formattedText = fInfo.format("This text will have a cyan back"); 22 | //System.out.println(formattedText); 23 | 24 | // ASSERT 25 | String expectedCode = Ansi.generateCode(fInfo); 26 | assertThat(formattedText, startsWith(expectedCode)); 27 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 28 | } 29 | 30 | @Test 31 | public void CanFormatWithMultipleAttributes() { 32 | // ARRANGE 33 | AnsiFormat fWarning = new AnsiFormat(RED_TEXT(), YELLOW_BACK(), BOLD()); 34 | 35 | // ACT 36 | String formattedText = fWarning.format("This bold text will be red on yellow"); 37 | //System.out.println(formattedText); 38 | 39 | // ASSERT 40 | String expectedCode = Ansi.generateCode(fWarning); 41 | assertThat(formattedText, startsWith(expectedCode)); 42 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 43 | } 44 | 45 | @Test 46 | public void CanFormatWithTrueColorAttributes() { 47 | // ARRANGE 48 | AnsiFormat fWarning = new AnsiFormat(TEXT_COLOR(202), BACK_COLOR(225, 255, 47), BOLD()); 49 | 50 | // ACT 51 | String formattedText = fWarning.format("This bold text will be kinda-orange on greenish-yellow"); 52 | //System.out.println(formattedText); 53 | 54 | // ASSERT 55 | String expectedCode = Ansi.generateCode(fWarning); 56 | assertThat(formattedText, startsWith(expectedCode)); 57 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 58 | } 59 | 60 | @Test 61 | public void CanFormatInline() { 62 | // ARRANGE 63 | 64 | // ACT 65 | String formattedText = colorize("This text will be yellow on magenta", YELLOW_TEXT(), MAGENTA_BACK()); 66 | //System.out.println(formattedText); 67 | 68 | // ASSERT 69 | String expectedCode = Ansi.generateCode(YELLOW_TEXT(), MAGENTA_BACK()); 70 | assertThat(formattedText, startsWith(expectedCode)); 71 | assertThat("Message should clear its format", formattedText, endsWith(Ansi.RESET)); 72 | } 73 | 74 | @Test 75 | public void CanMakeItFabulous() { 76 | // ARRANGE 77 | String text = "This text will be magenta"; 78 | 79 | // ACT 80 | String formattedText = makeItFabulous(text, MAGENTA_TEXT()); 81 | 82 | // ASSERT 83 | assertThat(formattedText, equalTo(colorize(text, MAGENTA_TEXT()))); 84 | } 85 | 86 | @Test 87 | public void CanUseAnsiFormatOrArray() { 88 | // ARRANGE 89 | AnsiFormat formatNotation = new AnsiFormat(BLACK_TEXT(), BLACK_BACK()); 90 | Attribute[] arrayNotation = new Attribute[]{BLACK_TEXT(), BLACK_BACK()}; 91 | String text = "This text will be black on black"; 92 | 93 | // ACT 94 | String formatNotationOutput = formatNotation.format(text); 95 | String arrayNotationOutput = Ansi.colorize(text, arrayNotation); 96 | 97 | // ASSERT 98 | assertThat(formatNotationOutput, equalTo(arrayNotationOutput)); 99 | assertThat(formatNotationOutput.compareTo(arrayNotationOutput), equalTo(0)); 100 | } 101 | 102 | } --------------------------------------------------------------------------------