Fix default valu

This commit is contained in:
Anas Elgarhy 2022-03-25 16:51:01 +02:00
parent 139f951ebf
commit 645fb37233
3 changed files with 10 additions and 1 deletions

View file

@ -2,10 +2,12 @@ package com.anas.jcolorfulconsole;
import com.anas.jcolorfulconsole.color.BackgroundColor;
import com.anas.jcolorfulconsole.color.TextColor;
import com.anas.jcolorfulconsole.style.TextStyle;
public interface ConsoleManager {
void setTextColor(TextColor textColor);
void setBackgroundColor(BackgroundColor backgroundColor);
void setTextStyle(TextStyle textStyle);
void addProperty(ConsoleProperty property);
void removeProperty(ConsoleProperty property);

View file

@ -9,7 +9,7 @@ public class ASCIIColor implements ConsoleProperty {
this.code = code;
}
public static final ASCIIColor DEFAULT = new ASCIIColor((short)-1);
public static final ASCIIColor DEFAULT = new ASCIIColor((short)0);
@Override
public short getCode() {

View file

@ -5,6 +5,7 @@ import com.anas.jcolorfulconsole.ConsoleProperty;
import com.anas.jcolorfulconsole.color.BackgroundColor;
import com.anas.jcolorfulconsole.color.TextColor;
import com.anas.jcolorfulconsole.stringmake.StringProcessor;
import com.anas.jcolorfulconsole.style.TextStyle;
import java.util.ArrayList;
@ -18,6 +19,7 @@ public class DefaultConsoleManager implements ConsoleManager {
properties.add(TextColor.DEFAULT);
properties.add(BackgroundColor.DEFAULT);
properties.add(TextStyle.DEFAULT);
}
@Override
@ -30,6 +32,11 @@ public class DefaultConsoleManager implements ConsoleManager {
properties.set(1, backgroundColor);
}
@Override
public void setTextStyle(TextStyle textStyle) {
properties.set(2, textStyle);
}
@Override
public void addProperty(ConsoleProperty property) {
properties.add(property);