This commit is contained in:
Looly 2023-05-15 20:14:31 +08:00
parent 4670f21a8c
commit 2a5fa34fb8
2 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
private final int code; private final int code;
Ansi4BitBackgroundColor(int code) { Ansi4BitBackgroundColor(final int code) {
this.code = code; this.code = code;
} }
@ -131,7 +131,7 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
* @param isBackground 是否背景色 * @param isBackground 是否背景色
* @return 颜色代码 * @return 颜色代码
*/ */
public int getCode(boolean isBackground) { public int getCode(final boolean isBackground) {
return isBackground ? this.code : this.code - 10; return isBackground ? this.code : this.code - 10;
} }
@ -155,8 +155,8 @@ public enum Ansi4BitBackgroundColor implements AnsiElement {
* @param code Ansi 4bit 颜色代码 * @param code Ansi 4bit 颜色代码
* @return Ansi4BitBackgroundColor * @return Ansi4BitBackgroundColor
*/ */
public static Ansi4BitBackgroundColor of(int code) { public static Ansi4BitBackgroundColor of(final int code) {
for (Ansi4BitBackgroundColor item : Ansi4BitBackgroundColor.values()) { for (final Ansi4BitBackgroundColor item : Ansi4BitBackgroundColor.values()) {
if (item.getCode() == code) { if (item.getCode() == code) {
return item; return item;
} }

View File

@ -111,7 +111,7 @@ public enum Ansi4BitColor implements AnsiElement {
private final int code; private final int code;
Ansi4BitColor(int code) { Ansi4BitColor(final int code) {
this.code = code; this.code = code;
} }
@ -131,7 +131,7 @@ public enum Ansi4BitColor implements AnsiElement {
* @param isBackground 是否背景色 * @param isBackground 是否背景色
* @return 颜色代码 * @return 颜色代码
*/ */
public int getCode(boolean isBackground) { public int getCode(final boolean isBackground) {
return isBackground ? this.code + 10 : this.code; return isBackground ? this.code + 10 : this.code;
} }
@ -155,8 +155,8 @@ public enum Ansi4BitColor implements AnsiElement {
* @param code Ansi 4bit 颜色代码 * @param code Ansi 4bit 颜色代码
* @return Ansi4BitColor * @return Ansi4BitColor
*/ */
public static Ansi4BitColor of(int code) { public static Ansi4BitColor of(final int code) {
for (Ansi4BitColor item : Ansi4BitColor.values()) { for (final Ansi4BitColor item : Ansi4BitColor.values()) {
if (item.getCode() == code) { if (item.getCode() == code) {
return item; return item;
} }