Skip to content

Commit 32aeebf

Browse files
committed
added docstrings and method to create colors if empty
1 parent 6f523c2 commit 32aeebf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labelbox/schema/ontology.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Type(Enum):
191191
tool: Type
192192
name: str
193193
required: bool = False
194-
color: str = "#000000"
194+
color: str = None
195195
classifications: List[Classification] = field(default_factory=list)
196196
schema_id: Optional[str] = None
197197
feature_schema_id: Optional[str] = None
@@ -331,7 +331,7 @@ def _update_colors(self):
331331
hsv_color = (index * 1 / num_tools, 1, 1)
332332
rgb_color = tuple(
333333
int(255 * x) for x in colorsys.hsv_to_rgb(*hsv_color))
334-
if self.tools[index].color == "#000000":
334+
if self.tools[index].color is None:
335335
self.tools[index].color = '#%02x%02x%02x' % rgb_color
336336

337337
@classmethod

0 commit comments

Comments
 (0)