Skip to content

Commit 8e4ac77

Browse files
committed
Added BrickColor nodes
1 parent e8d6b93 commit 8e4ac77

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"type": "FUNCTION",
3+
"color": [
4+
200,
5+
100,
6+
50
7+
],
8+
"title": "BrickColor New",
9+
"inputs": {
10+
"colorName": {
11+
"defaultValue": "Bright red"
12+
}
13+
},
14+
"outputs": [
15+
"brickColor"
16+
]
17+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"type": "FUNCTION",
3+
"color": [
4+
200,
5+
100,
6+
50
7+
],
8+
"title": "BrickColor Random",
9+
"inputs": {},
10+
"outputs": [
11+
"brickColor"
12+
]
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import Optional
2+
from src.Node import Node
3+
4+
class BrickColorNew(Node):
5+
def __init__(self) -> None:
6+
super().__init__("nodes/brickcolor/brickcolornew.json")
7+
8+
def toLuau(self) -> Optional[str]:
9+
color_name = self.getInputValue("colorName") or "Bright red"
10+
11+
color_name_formatted = f'"{color_name}"'
12+
13+
r = f'BrickColor.new({color_name_formatted})'
14+
15+
self.setOutputValue("brickColor", r)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import Optional
2+
from src.Node import Node
3+
4+
class BrickColorRandom(Node):
5+
def __init__(self) -> None:
6+
super().__init__("nodes/brickcolor/brickcolorrandom.json")
7+
8+
def toLuau(self) -> Optional[str]:
9+
r = 'BrickColor.random()'
10+
11+
self.setOutputValue("brickColor", r)

0 commit comments

Comments
 (0)