Skip to content

EtchedTemplate

src.templates.normal.EtchedTemplate

Bases: VectorTemplate

Etched template first introduced in Commander Legends. Uses pinline colors for the background, except for Artifact cards. Uses pinline colors for the textbox always. No hollow crown, no companion or nyx layers.

Source code in src\templates\normal.py
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
class EtchedTemplate(VectorTemplate):
    """
    Etched template first introduced in Commander Legends. Uses pinline colors for the background,
    except for Artifact cards. Uses pinline colors for the textbox always. No hollow crown, no companion or
    nyx layers.
    """
    template_suffix = 'Etched'

    # Static properties
    background_group = None

    # Color Maps
    pinlines_color_map = {
        **pinlines_color_map.copy(),
        'W': [252, 254, 255],
        'Land': [136, 120, 98],
        'Artifact': [194, 210, 221],
        'Colorless': [194, 210, 221]}

    """
    * Colors
    """

    @auto_prop_cached
    def pinlines_colors(self) -> Union[SolidColor, list[dict]]:
        # Use Artifact color even for colored artifacts
        if self.is_artifact and not self.is_land:
            return psd.get_pinline_gradient(LAYERS.ARTIFACT, color_map=self.pinlines_color_map)
        return psd.get_pinline_gradient(self.pinlines, color_map=self.pinlines_color_map)

    @auto_prop_cached
    def crown_colors(self) -> Optional[str]:
        # Use Artifact color even for colored artifacts
        if self.is_artifact and not self.is_land:
            return LAYERS.ARTIFACT
        return self.pinlines

    @auto_prop_cached
    def textbox_colors(self) -> Optional[str]:
        # Normal pinline coloring rules
        return self.pinlines

    """
    * Layers
    """

    @auto_prop_cached
    def divider_layer(self) -> Optional[ArtLayer]:
        # Divider is grouped
        return psd.getLayerSet(LAYERS.DIVIDER, self.text_group)

    """
    * Shapes
    """

    @auto_prop_cached
    def enabled_shapes(self) -> list[Union[ArtLayer, LayerSet, None]]:
        """Enable Legendary pinlines shape if card is Legendary."""
        if self.is_legendary:
            return [psd.getLayer(LAYERS.LEGENDARY, [self.pinlines_group, LAYERS.SHAPE])]
        return []

    """
    * Masks
    """

    @auto_prop_cached
    def enabled_masks(self) -> list[Union[dict, list, ArtLayer, LayerSet, None]]:
        """Enable pinlines mask if card is Legendary."""
        return [psd.getLayer(LAYERS.NORMAL, [self.pinlines_group, LAYERS.SHAPE])] if self.is_legendary else []

    """
    * Methods
    """

    def enable_crown(self) -> None:
        """Enable Legendary Crown shape."""
        psd.getLayer(f"{LAYERS.LEGENDARY} {LAYERS.SHADOWS}").visible = True

Attributes

pinlines_color_map = {None: pinlines_color_map.copy(), 'W': [252, 254, 255], 'Land': [136, 120, 98], 'Artifact': [194, 210, 221], 'Colorless': [194, 210, 221]}

  • Colors

Functions

enable_crown() -> None

Enable Legendary Crown shape.

Source code in src\templates\normal.py
640
641
642
def enable_crown(self) -> None:
    """Enable Legendary Crown shape."""
    psd.getLayer(f"{LAYERS.LEGENDARY} {LAYERS.SHADOWS}").visible = True

enabled_masks() -> list[Union[dict, list, ArtLayer, LayerSet, None]]

Enable pinlines mask if card is Legendary.

Source code in src\templates\normal.py
631
632
633
634
@auto_prop_cached
def enabled_masks(self) -> list[Union[dict, list, ArtLayer, LayerSet, None]]:
    """Enable pinlines mask if card is Legendary."""
    return [psd.getLayer(LAYERS.NORMAL, [self.pinlines_group, LAYERS.SHAPE])] if self.is_legendary else []

enabled_shapes() -> list[Union[ArtLayer, LayerSet, None]]

Enable Legendary pinlines shape if card is Legendary.

Source code in src\templates\normal.py
620
621
622
623
624
625
@auto_prop_cached
def enabled_shapes(self) -> list[Union[ArtLayer, LayerSet, None]]:
    """Enable Legendary pinlines shape if card is Legendary."""
    if self.is_legendary:
        return [psd.getLayer(LAYERS.LEGENDARY, [self.pinlines_group, LAYERS.SHAPE])]
    return []