discord/gridrender.py
def renderPalette(pal):
    """Returns a image rendering of the palette."""
    pal_b = pal.tobytes() # RRR... GGG... BBB...
    R = pal_b[0:256]
    G = pal_b[256:-256]
    B = pal_b[-256:]

    RGB = b''.join(([bytes(c) for c in zip(R,G,B)]))
    im = Image.frombytes(mode='RGB', data=RGB, size=(1,256))

    return im
Returns a image rendering of the palette.
Returns a image rendering of the palette.
Returns a image rendering of the palette .
def renderPalette(pal):
    pal_b = pal.tobytes() 
    R = pal_b[0:256]
    G = pal_b[256:-256]
    B = pal_b[-256:]
    RGB = b''.join(([bytes(c) for c in zip(R,G,B)]))
    im = Image.frombytes(mode='RGB', data=RGB, size=(1,256))
    return im
def renderPalette ( pal ) : pal_b = pal . tobytes ( ) R = pal_b [ 0 : 256 ] G = pal_b [ 256 : - 256 ] B = pal_b [ - 256 : ] RGB = b'' . join ( ( [ bytes ( c ) for c in zip ( R , G , B ) ] ) ) im = Image . frombytes ( mode = 'RGB' , data = RGB , size = ( 1 , 256 ) ) return im
Returns a image rendering of the palette.
Returns a image rendering of the palette .
"""Returns a image rendering of the palette.""" # RRR... GGG... BBB...
pal