# automatically generated by the FlatBuffers compiler, do not modify

# namespace: fbs

import flatbuffers
from flatbuffers.compat import import_numpy
from typing import Any
np = import_numpy()

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

    @classmethod
    def SizeOf(cls) -> int:
        return 16

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

    # Color
    def Values(self, j = None):
        if j is None:
            return [self._tab.Get(flatbuffers.number_types.Float32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0 + i * 4)) for i in range(self.ValuesLength())]
        elif j >= 0 and j < self.ValuesLength():
            return self._tab.Get(flatbuffers.number_types.Float32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0 + j * 4))
        else:
            return None

    # Color
    def ValuesAsNumpy(self):
        return self._tab.GetArrayAsNumpy(flatbuffers.number_types.Float32Flags, self._tab.Pos + 0, self.ValuesLength())

    # Color
    def ValuesLength(self) -> int:
        return 4

    # Color
    def ValuesIsNone(self) -> bool:
        return False


def CreateColor(builder, values):
    builder.Prep(4, 16)
    for _idx0 in range(4 , 0, -1):
        builder.PrependFloat32(values[_idx0-1])
    return builder.Offset()
