diff --git a/src/main/java/org/fusesource/jansi/io/Colors.java b/src/main/java/org/fusesource/jansi/io/Colors.java index 0ff995d2..d1599a25 100644 --- a/src/main/java/org/fusesource/jansi/io/Colors.java +++ b/src/main/java/org/fusesource/jansi/io/Colors.java @@ -164,4 +164,8 @@ private static double pivotXyz(double n) { private static double sqr(double n) { return n * n; } + + public static String rgbToAnsi(int r, int g, int b) { + return String.format("\u001B[38;2;%d;%d;%dm", r, g, b); + } } diff --git a/src/main/resources/org/fusesource/jansi/internal/native/FreeBSD/x86/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/FreeBSD/x86/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/FreeBSD/x86_64/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/FreeBSD/x86_64/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/arm/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/arm/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/arm64/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/arm64/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/armv6/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/armv6/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/armv7/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/armv7/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/ppc64/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/ppc64/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/x86/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/x86/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Linux/x86_64/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Linux/x86_64/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Mac/arm64/libjansi.jnilib b/src/main/resources/org/fusesource/jansi/internal/native/Mac/arm64/libjansi.jnilib old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Mac/x86/libjansi.jnilib b/src/main/resources/org/fusesource/jansi/internal/native/Mac/x86/libjansi.jnilib old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Mac/x86_64/libjansi.jnilib b/src/main/resources/org/fusesource/jansi/internal/native/Mac/x86_64/libjansi.jnilib old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Windows/arm64/libjansi.so b/src/main/resources/org/fusesource/jansi/internal/native/Windows/arm64/libjansi.so old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Windows/x86/jansi.dll b/src/main/resources/org/fusesource/jansi/internal/native/Windows/x86/jansi.dll old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/internal/native/Windows/x86_64/jansi.dll b/src/main/resources/org/fusesource/jansi/internal/native/Windows/x86_64/jansi.dll old mode 100755 new mode 100644 diff --git a/src/main/resources/org/fusesource/jansi/jansi.txt b/src/main/resources/org/fusesource/jansi/jansi.txt index a62a6f40..da485b9c 100644 --- a/src/main/resources/org/fusesource/jansi/jansi.txt +++ b/src/main/resources/org/fusesource/jansi/jansi.txt @@ -1,8 +1,8 @@ -[?7h -┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐ -│██├┘█████└┬┘█████└┬┘██████│▐▌│ -┌──┐ │██│██▄▄▄██│██┌─┐██│██▄▄▄▄ │▄▄│ -│▒▒└─┘▒█│▒█┌─┐▒█│▒█│ │▒█│ ▀▀▀▀▒█│▒█│ -└┐▓▓▓▓▓┌┤▓▓│ │▓▓│▓▓│ │▓▓│▀▓▓▓▓▓▀│▓▓│ -└─────┘└──┘ └──┴──┘ └──┴───────┴──┘ - +[?7h +┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐ +│██├┘█████└┬┘█████└┬┘██████│▐▌│ +┌──┐ │██│██▄▄▄██│██┌─┐██│██▄▄▄▄ │▄▄│ +│▒▒└─┘▒█│▒█┌─┐▒█│▒█│ │▒█│ ▀▀▀▀▒█│▒█│ +└┐▓▓▓▓▓┌┤▓▓│ │▓▓│▓▓│ │▓▓│▀▓▓▓▓▓▀│▓▓│ +└─────┘└──┘ └──┴──┘ └──┴───────┴──┘ + diff --git a/src/test/java/org/fusesource/jansi/AnsiConsoleExample2.java b/src/test/java/org/fusesource/jansi/AnsiConsoleExample2.java old mode 100755 new mode 100644 diff --git a/src/test/java/org/fusesource/jansi/RbgToAnsiExample.java b/src/test/java/org/fusesource/jansi/RbgToAnsiExample.java new file mode 100644 index 00000000..62e2c4cd --- /dev/null +++ b/src/test/java/org/fusesource/jansi/RbgToAnsiExample.java @@ -0,0 +1,13 @@ +package org.fusesource.jansi; + +import org.fusesource.jansi.io.Colors; + +public class RbgToAnsiExample { + + + public static void main(String[] args){ + System.out.println(Colors.rgbToAnsi(100,200,200)); + System.out.println("text"); + } + +} diff --git a/src/test/resources/jansi.ans b/src/test/resources/jansi.ans old mode 100755 new mode 100644 index b400740e..d9d3c524 --- a/src/test/resources/jansi.ans +++ b/src/test/resources/jansi.ans @@ -1,8 +1,8 @@ -[?7h -ĿĿ Ŀ Ŀ - -Ŀ Ŀ  -Ŀ  ߱ -ڴ  ߲ - - +[?7h +ĿĿ Ŀ Ŀ + +Ŀ Ŀ  +Ŀ  ߱ +ڴ  ߲ + +