本文整理汇总了Python中palette.Palette.append方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.append方法的具体用法?Python Palette.append怎么用?Python Palette.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类palette.Palette
的用法示例。
在下文中一共展示了Palette.append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __save_clicked
# 需要导入模块: from palette import Palette [as 别名]
# 或者: from palette.Palette import append [as 别名]
def __save_clicked(self, button):
pal = Palette()
mask = self.editor.get_mask()
for i, shape in enumerate(mask):
for j, col in enumerate(shape):
col_name = "mask#%d primary#%d" % (i, j) # NOT localised
pal.append(col, col_name)
preview = HCYMaskPreview()
pal.save_via_dialog(title=_("Save mask as a Gimp palette"), parent=self, preview=preview)
示例2: getPalettesFromBankData
# 需要导入模块: from palette import Palette [as 别名]
# 或者: from palette.Palette import append [as 别名]
def getPalettesFromBankData(self):
assert(self.PALETTE_COLOR_AMOUNT > 0)
assert(self.PALETTE_AMOUNT > 0)
paletteList = []
pointer = 0
for palNum in range(0, self.PALETTE_AMOUNT):
pal = Palette(False)
for colorNum in range(0, self.PALETTE_COLOR_AMOUNT):
B = ((self.data[pointer+1] & 0b01111100) >> 2)
G = (((self.data[pointer+1] & 0b00000011) << 3) + ((self.data[pointer] & 0b11100000) >> 5))
R = self.data[pointer] & 0b00011111
pal.append(Color(red=R, green=G, blue=B, type=False))
pointer += 2
pal.switchType()
paletteList.append(pal)
self.setPalettes(paletteList)
return self.palettes
示例3: __save_clicked
# 需要导入模块: from palette import Palette [as 别名]
# 或者: from palette.Palette import append [as 别名]
def __save_clicked(self, button):
pal = Palette()
mask = self.editor.get_mask()
for i, shape in enumerate(mask):
for j, col in enumerate(shape):
col_name = "mask#%d primary#%d" % (i, j) # NOT localised
pal.append(col, col_name)
preview = HCYMaskPreview()
preview.set_size_request(128, 128)
target_mgr = self.target.get_color_manager()
prefs_ro = deepcopy(target_mgr.get_prefs())
datapath = target_mgr.get_data_path()
mgr = ColorManager(prefs=prefs_ro, datapath=datapath)
preview.set_color_manager(mgr)
preview.set_managed_color(self.editor.get_managed_color())
palette_save_via_dialog(pal, title=_("Save mask as a Gimp palette"),
parent=self, preview=preview)
示例4: __init__
# 需要导入模块: from palette import Palette [as 别名]
# 或者: from palette.Palette import append [as 别名]
def __init__(self, data=[], hasPalettes=False):
self.data = data
self.bankHasPalettes = hasPalettes
self.palettes = None
if ((self.bankHasPalettes) and (data is not None)):
self.palettes = self.getPalettesFromBankData()
# two hardcoded palettes, not sure where they are in ROM yet
# or why they are part of tilemap's palette selection
hardcodedPalette1 = Palette(True)
hardcodedPalette2 = Palette(True)
for x in range(0, self.PALETTE_COLOR_AMOUNT):
hardcodedPalette1.append(self.COLORS_HARDCODED_1[x])
hardcodedPalette2.append(self.COLORS_HARDCODED_2[x])
self.palettes.append(hardcodedPalette1)
self.palettes.append(hardcodedPalette2)
self.image = None
self.tileAmount = 1024
self.createImage()