-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4682c4a
commit a8ca6dd
Showing
8 changed files
with
210 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
# Highlighter | ||
RichText highlighting Lua code with a pure Lua lexer | ||
|
||
|
||
Usage: | ||
```Lua | ||
local Highlighter = require(script.Highlighter) | ||
|
||
Highlighter(TextLabel) -- Highlights the text in the TextLabel | ||
|
||
-- Alternatively | ||
Highlighter.Highlight(TextLabel) -- Identical to just calling | ||
``` | ||
Changing Colors: | ||
```Lua | ||
-- Any of the given entries can be left nil for default | ||
Highlighter.UpdateColors({ | ||
background = Color3.new(...), | ||
iden = Color3.new(...), | ||
keyword = Color3.new(...), | ||
builtin = Color3.new(...), | ||
string = Color3.new(...), | ||
number = Color3.new(...), | ||
comment = Color3.new(...), | ||
operator = Color3.new(...) | ||
Highlighter.highlight({ | ||
-- The object to syntax highlight | ||
textObject: TextLabel | TextBox, | ||
-- The source text for highlighting- defaults to textObject.Text | ||
src: string?, | ||
-- Update even if there are no changes since last highlight | ||
forceUpdate: boolean?, | ||
-- Lexer for tokenizing src, defaults to the bundled Lua lexer | ||
lexer: Lexer?, | ||
}) | ||
``` | ||
Reset colors to default: | ||
|
||
Changing the highlight colors: | ||
```Lua | ||
Highlighter.UpdateColors() | ||
Highlighter.setTokenColors({ | ||
tokenName = Color3.new(...), | ||
... | ||
}) | ||
-- Automatically triggers Highlighter.refresh() which updates existing highlights to the new colors | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file lists tools managed by Aftman, a cross-platform toolchain manager. | ||
# For more information, see https://github.com/LPGhatguy/aftman | ||
|
||
# To add a new tool, add an entry to this table. | ||
[tools] | ||
rojo = "rojo-rbx/[email protected]" | ||
run-in-roblox = "rojo-rbx/[email protected]" | ||
wally = "upliftgames/[email protected]" | ||
selene = "Kampfkarren/[email protected]" | ||
stylua = "JohnnyMorganz/[email protected]" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.