Helper for a simple hex parser
| 3742 | |
| 3743 | // Helper for a simple hex parser |
| 3744 | static int hex2int(lua_State *L, char c) { |
| 3745 | if (c >= '0' && c <= '9') |
| 3746 | return c-'0'; |
| 3747 | if (c >= 'a' && c <= 'f') |
| 3748 | return c - 'a' + 10; |
| 3749 | if (c >= 'A' && c <= 'F') |
| 3750 | return c - 'A' + 10; |
| 3751 | return luaL_error(L, "invalid hex in colour"); |
| 3752 | } |
| 3753 | |
| 3754 | static const struct ColorMapping |
| 3755 | { |
no test coverage detected