0, 0, 0 215, 95, 0 175, 95, 0 255, 215, 95 0, 95, 95 255, 95, 135 255, 175, 0 238, 238, 238 128, 128, 128 // 8 215, 135, 0 175, 135, 0 255, 255, 95 0, 135, 95 255, 135, 135 255, 215, 0 255, 255, 255 def vec4_to_hex(colors): for c in colors: print('#%08x' % ( (round(c[0] * 255) << 24) & 0xFF000000| (round(c[1] * 255) << 16) & 0x00FF0000| (round(c[2] * 255) << 8 ) & 0x0000FF00| (round(c[3] * 255 ) & 0x000000FF))) def hex_to_vec4(colors): for c in colors: print('%d,%d,%d,%d' % ( (c >> 24 & 0xFF), (c >> 16 & 0xFF), (c >> 8 & 0xFF), (c & 0xFF))) def hex_to_vec3(colors): for c in colors: print('%d,%d,%d' % ( (c >> 16 & 0xFF), (c >> 8 & 0xFF), (c & 0xFF)))