Skip to content

Commit c40aa51

Browse files
committed
Added BrickColor to RGB node
1 parent 8e4ac77 commit c40aa51

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"type": "FUNCTION",
3+
"color": [
4+
200,
5+
100,
6+
50
7+
],
8+
"title": "BrickColor To RGB",
9+
"inputs": {
10+
"brickColor": {
11+
"defaultValue": ""
12+
}
13+
},
14+
"outputs": [
15+
"r",
16+
"g",
17+
"b"
18+
]
19+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing import Optional
2+
from src.Node import Node
3+
4+
class BrickColorToRGB(Node):
5+
def __init__(self) -> None:
6+
super().__init__("nodes/brickcolor/brickcolortorgb.json")
7+
8+
def toLuau(self) -> Optional[str]:
9+
brick_color = self.getInputValue("brickColor")
10+
11+
self.setOutputValue("r", f'{brick_color}.r')
12+
self.setOutputValue("g", f'{brick_color}.g')
13+
self.setOutputValue("b", f'{brick_color}.b')

0 commit comments

Comments
 (0)