Bases: SagaMod
, VectorTemplate
Saga mod for vector based templates.
Source code in src\templates\saga.py
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324 | class VectorSagaMod(SagaMod, VectorTemplate):
"""Saga mod for vector based templates."""
# Color Maps
saga_banner_color_map = saga_banner_color_map.copy()
saga_stripe_color_map = saga_stripe_color_map.copy()
"""
* Colors
"""
@auto_prop_cached
def saga_banner_colors(self) -> list[list[int]]:
"""Must be returned as list of RGB/CMYK integer lists."""
if len(self.pinlines) == 2:
return [self.saga_banner_color_map.get(c, [0, 0, 0]) for c in self.pinlines]
return [self.saga_banner_color_map.get(self.pinlines, [0, 0, 0])]
@auto_prop_cached
def saga_stripe_colors(self) -> list[int]:
"""Must be returned as an RGB/CMYK integer list."""
if len(self.pinlines) == 2:
return self.saga_stripe_color_map.get('Dual', [0, 0, 0])
return self.saga_stripe_color_map.get(self.pinlines, [0, 0, 0])
"""
* Blending Masks
"""
@auto_prop_cached
def saga_banner_masks(self) -> list[ArtLayer]:
return [psd.getLayer(LAYERS.HALF, [self.mask_group, LAYERS.BANNER])]
"""
* Groups
"""
@auto_prop_cached
def saga_banner_group(self) -> LayerSet:
return psd.getLayerSet(LAYERS.BANNER, self.saga_group)
@auto_prop_cached
def saga_stripe_group(self) -> LayerSet:
return psd.getLayerSet(LAYERS.STRIPE, self.saga_group)
"""
* Shape Layers
"""
@auto_prop_cached
def saga_stripe_shape(self) -> ArtLayer:
"""The stripe shape in the middle of the Saga banner."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
[self.saga_stripe_group, LAYERS.SHAPE])
@auto_prop_cached
def saga_banner_shape(self) -> ArtLayer:
"""The overall Saga banner shape."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
[self.saga_banner_group, LAYERS.SHAPE])
@auto_prop_cached
def saga_trim_shape(self) -> ArtLayer:
"""The gold trim on the Saga Banner."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
self.saga_group)
"""
* Saga Frame Layer Methods
"""
def frame_layers_saga(self):
"""Enable layers required by Saga cards."""
# Enable Saga group
self.saga_group.visible = True
# Add colors
self.generate_layer(
group=self.saga_banner_group,
colors=self.saga_banner_colors,
masks=self.saga_banner_masks)
self.generate_layer(
group=self.saga_stripe_group,
colors=self.saga_stripe_colors)
|
Attributes
saga_stripe_color_map = saga_stripe_color_map.copy()
Functions
frame_layers_saga()
Enable layers required by Saga cards.
Source code in src\templates\saga.py
311
312
313
314
315
316
317
318
319
320
321
322
323
324 | def frame_layers_saga(self):
"""Enable layers required by Saga cards."""
# Enable Saga group
self.saga_group.visible = True
# Add colors
self.generate_layer(
group=self.saga_banner_group,
colors=self.saga_banner_colors,
masks=self.saga_banner_masks)
self.generate_layer(
group=self.saga_stripe_group,
colors=self.saga_stripe_colors)
|
saga_banner_colors() -> list[list[int]]
Must be returned as list of RGB/CMYK integer lists.
Source code in src\templates\saga.py
| @auto_prop_cached
def saga_banner_colors(self) -> list[list[int]]:
"""Must be returned as list of RGB/CMYK integer lists."""
if len(self.pinlines) == 2:
return [self.saga_banner_color_map.get(c, [0, 0, 0]) for c in self.pinlines]
return [self.saga_banner_color_map.get(self.pinlines, [0, 0, 0])]
|
saga_banner_shape() -> ArtLayer
The overall Saga banner shape.
Source code in src\templates\saga.py
| @auto_prop_cached
def saga_banner_shape(self) -> ArtLayer:
"""The overall Saga banner shape."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
[self.saga_banner_group, LAYERS.SHAPE])
|
saga_stripe_colors() -> list[int]
Must be returned as an RGB/CMYK integer list.
Source code in src\templates\saga.py
| @auto_prop_cached
def saga_stripe_colors(self) -> list[int]:
"""Must be returned as an RGB/CMYK integer list."""
if len(self.pinlines) == 2:
return self.saga_stripe_color_map.get('Dual', [0, 0, 0])
return self.saga_stripe_color_map.get(self.pinlines, [0, 0, 0])
|
saga_stripe_shape() -> ArtLayer
The stripe shape in the middle of the Saga banner.
Source code in src\templates\saga.py
| @auto_prop_cached
def saga_stripe_shape(self) -> ArtLayer:
"""The stripe shape in the middle of the Saga banner."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
[self.saga_stripe_group, LAYERS.SHAPE])
|
saga_trim_shape() -> ArtLayer
The gold trim on the Saga Banner.
Source code in src\templates\saga.py
| @auto_prop_cached
def saga_trim_shape(self) -> ArtLayer:
"""The gold trim on the Saga Banner."""
return psd.getLayer(
LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
self.saga_group)
|