Add support for hexadecimal values in editor value fields

This commit is contained in:
Wojtek Figat
2020-12-31 15:35:31 +01:00
parent 3ab04598da
commit 9b891d0c55
2 changed files with 42 additions and 6 deletions

View File

@@ -13,6 +13,16 @@ namespace FlaxEngine
/// </summary>
public static class StringUtils
{
/// <summary>
/// Checks if given character is valid hexadecimal digit.
/// </summary>
/// <param name="c">The hex character.</param>
/// <returns>True if character is valid hexadecimal digit, otherwise false.</returns>
public static bool IsHexDigit(char c)
{
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}
/// <summary>
/// Parse hexadecimals digit to value.
/// </summary>