betty.extension.cotton_candy.config module

Provide configuration for the Cotton Candy extension.

class betty.extension.cotton_candy.config.ColorConfiguration[source]

Bases: Configuration

Configure a color.

__init__(hex_value: str)[source]
dump() bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void][source]

Dump this instance to a portable format.

property hex: str

The color’s hexadecimal value.

load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) None[source]

Load dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

update(other: Self) None[source]

Update this configuration with the values from other.

class betty.extension.cotton_candy.config.CottonCandyConfiguration[source]

Bases: Configuration

Provide configuration for the betty.extension.cotton_candy.CottonCandy extension.

DEFAULT_PRIMARY_ACTIVE_COLOR = '#ff69b4'
DEFAULT_PRIMARY_INACTIVE_COLOR = '#ffc0cb'
__init__(*, featured_entities: Sequence[EntityReference[UserFacingEntity & Entity]] | None = None, primary_inactive_color: str = '#ffc0cb', primary_active_color: str = '#ff69b4', link_inactive_color: str = '#149988', link_active_color: str = '#2a615a')[source]
dump() bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void][source]

Dump this instance to a portable format.

property featured_entities: EntityReferenceSequence[UserFacingEntity & Entity]

The entities featured on the front page.

The color for active hyperlinks.

The color for inactive hyperlinks.

load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) None[source]

Load dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

property primary_active_color: ColorConfiguration

The color for active primary/CTA elements.

property primary_inactive_color: ColorConfiguration

The color for inactive primary/CTA elements.

update(other: Self) None[source]

Update this configuration with the values from other.