def read_palettes(time_of_day=1, config=config): """ Loads up the .pal file? """ palettes = [] actual_time_of_day = ["morn", "day", "nite"][time_of_day] filename = "{}.pal".format(actual_time_of_day) filepath = os.path.join(config.palette_dir, filename) lines = open(filepath, "r").readlines() colors = gfx.read_rgb_macros(lines) palettes = [colors[i:i+4] for i in xrange(0, len(colors), 4)] return palettes
def read_palettes(time_of_day=1, config=config): """ Loads up the .pal file? """ palettes = [] actual_time_of_day = ["morn", "day", "nite"][time_of_day] filename = "{}.pal".format(actual_time_of_day) filepath = os.path.join(config.palette_dir, filename) lines = open(filepath, "r").readlines() colors = gfx.read_rgb_macros(lines) palettes = [colors[i:i + 4] for i in xrange(0, len(colors), 4)] return palettes
def get_palettes(filename): lines = open(filename, "r").readlines() colors = gfx.read_rgb_macros(lines) palettes = [colors[i : i + 4] for i in xrange(0, len(colors), 4)] return palettes
def get_palettes(filename): lines = open(filename, 'r').readlines() colors = gfx.read_rgb_macros(lines) palettes = [colors[i:i + 4] for i in xrange(0, len(colors), 4)] return palettes