escape.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---@meta
  2. ---Escape sequences
  3. -------------------
  4. ---The escape sequence sets the text color to `color`.
  5. ---@param color mt.ColorString
  6. function minetest.get_color_escape_sequence(color) end
  7. -- Equivalent to:
  8. --
  9. -- ```lua
  10. -- minetest.get_color_escape_sequence(color) .. message ..
  11. -- minetest.get_color_escape_sequence("#ffffff")
  12. -- ```
  13. ---@param color mt.ColorString
  14. ---@param message string
  15. function minetest.colorize(color, message) end
  16. -- The escape sequence sets the background of the whole text element to
  17. -- `color`. Only defined for item descriptions and tooltips.
  18. ---@param color mt.ColorString
  19. function minetest.get_background_escape_sequence(color) end
  20. -- Removes foreground colors added by `get_color_escape_sequence`.
  21. ---@param str string
  22. function minetest.strip_foreground_colors(str) end
  23. -- Removes background colors added by `get_background_escape_sequence`.
  24. ---@param str string
  25. function minetest.strip_background_colors(str) end
  26. -- Removes all color escape sequences.
  27. ---@param str string
  28. function minetest.strip_colors(str) end