627 B
627 B
addRule
Adds a new rule for special coloring
Parameteres:
stringa pattern - check out this page: (https://riptutorial.com/lua/example/20315/lua-pattern-matching)number|colortext colornumber|colorbackground color - optional
Returns:
objectThe object in use
Usage:
- Changes the color of all numbers
local mainFrame = basalt.createFrame()
local aTextfield = mainFrame:addTextfield():addRule("%d", colors.lightBlue)
<textfield>
<rules>
<rule>
<pattern>%d</pattern>
<fg>lightBlue</fg>
</rule>
</rules>
</textfield>