예제 #1
0
 def write_to_flatbuffer(self, builder: Builder):
     FlatColor.ColorStart(builder)
     FlatColor.ColorAddR(builder, self.red)
     FlatColor.ColorAddG(builder, self.green)
     FlatColor.ColorAddB(builder, self.blue)
     FlatColor.ColorAddA(builder, self.alpha)
     return FlatColor.ColorEnd(builder)
예제 #2
0
 def create_color(self, alpha, red, green, blue):
     colorBuilder = self.builder
     # Color.CreateColor(colorBuilder, alpha, red, green, blue)
     Color.ColorStart(colorBuilder)
     Color.ColorAddA(colorBuilder, alpha)
     Color.ColorAddR(colorBuilder, red)
     Color.ColorAddG(colorBuilder, green)
     Color.ColorAddB(colorBuilder, blue)
     return Color.ColorEnd(colorBuilder)