# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

class Color(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsColor(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Color()
        x.Init(buf, n + offset)
        return x

    # Color
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Color
    def A(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Color
    def R(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Color
    def G(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Color
    def B(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

def ColorStart(builder): builder.StartObject(4)
def ColorAddA(builder, a): builder.PrependUint8Slot(0, a, 0)
def ColorAddR(builder, r): builder.PrependUint8Slot(1, r, 0)
def ColorAddG(builder, g): builder.PrependUint8Slot(2, g, 0)
def ColorAddB(builder, b): builder.PrependUint8Slot(3, b, 0)
def ColorEnd(builder): return builder.EndObject()
