Current section

Files

Jump to
wallet_passes lib wallet_passes apple visual.ex
Raw

lib/wallet_passes/apple/visual.ex

defmodule WalletPasses.Apple.Visual do
@moduledoc "Apple Wallet visual configuration for a pass."
# TODO: first-class retina variants. Apple supports @2x and @3x variants of
# icon.png, logo.png, strip.png, thumbnail.png, and background.png; we
# currently only expose the @1x base for icon/strip/thumbnail (no logo or
# background field at all). Consumers can ship retina variants today via the
# `:localized_images` option on Apple.Builder.build_pkpass/4 (using a
# synthetic locale or by listing the filenames there), but a first-class
# %Apple.Visual{}-side path would be cleaner. See guides/apple-wallet.md and
# guides/theming.md.
defstruct [
:background_color,
:foreground_color,
:label_color,
:logo_text,
:strip_image_path,
:thumbnail_path,
:icon_path,
]
@type t :: %__MODULE__{
background_color: String.t() | nil,
foreground_color: String.t() | nil,
label_color: String.t() | nil,
logo_text: String.t() | nil,
strip_image_path: String.t() | nil,
thumbnail_path: String.t() | nil,
icon_path: String.t() | nil,
}
def new(opts \\ []), do: struct!(__MODULE__, opts)
end