mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 15:22:53 +02:00
- Documented
This commit is contained in:
parent
2e5ff166a6
commit
6aa314603c
@ -51,15 +51,26 @@ public enum SimpleColor: string
|
|||||||
DEFAULT = "99" // NOT UNIVERSALLY SUPPORTED
|
DEFAULT = "99" // NOT UNIVERSALLY SUPPORTED
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the hex control character if color is a hexadecimal color code, the ASCII control character if color is two ASCII digits, and throw an exception if it's neither
|
/**
|
||||||
// This function might be useless now that set_fg and set_fg_bg have been changed, but I'll keep it in case it's needed later.
|
* Return the hex control character if color is a hexadecimal color code,
|
||||||
char generate_color_control_char(string color)
|
* the ASCII control character if color is two ASCII digits, and throw an
|
||||||
|
* exception if it's neither.
|
||||||
|
*
|
||||||
|
* This function might be useless now that set_fg and set_fg_bg have been
|
||||||
|
* changed, but I'll keep it in case it's needed later.
|
||||||
|
*
|
||||||
|
* Params:
|
||||||
|
* color = the color to check for
|
||||||
|
*
|
||||||
|
* Returns: the color control type
|
||||||
|
*/
|
||||||
|
private char generate_color_control_char(string color)
|
||||||
{
|
{
|
||||||
if (color.length == 6)
|
if(color.length == 6)
|
||||||
{
|
{
|
||||||
return ControlCode.HexColor;
|
return ControlCode.HexColor;
|
||||||
}
|
}
|
||||||
else if (color.length == 2)
|
else if(color.length == 2)
|
||||||
{
|
{
|
||||||
return ControlCode.AsciiColor;
|
return ControlCode.AsciiColor;
|
||||||
}
|
}
|
||||||
@ -148,7 +159,6 @@ public string setForeground(SimpleColor color)
|
|||||||
return ControlCode.AsciiColor~color;
|
return ControlCode.AsciiColor~color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a string that sets the foreground and background color (except enum)
|
* Generate a string that sets the foreground and background color (except enum)
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user