Artwork

public struct Artwork: Codable

An object that represents an artwork

  • The maximum width available for the image

    Declaration

    Swift

    public let width: Int
  • The maximum height available for the image

    Declaration

    Swift

    public let height: Int
  • url

    The URL to request the image asset. The image file name must be preceded by {w}x{h}, as placeholders for the width and height values

    Declaration

    Swift

    public let url: String
  • The average background color of the image

    Declaration

    Swift

    public let bgColor: String?
  • The primary text color that may be used if the background color is displayed

    Declaration

    Swift

    public let textColor1: String?
  • The secondary text color that may be used if the background color is displayed

    Declaration

    Swift

    public let textColor2: String?
  • The tertiary text color that may be used if the background color is displayed

    Declaration

    Swift

    public let textColor3: String?
  • The final post-tertiary text color that maybe be used if the background color is displayed

    Declaration

    Swift

    public let textColor4: String?
  • Returns a URL to retrieve the artwork image at a specific width (artwork images are square).

    Declaration

    Swift

    public func url(forWidth width: Int) -> URL?

    Parameters

    forWidth

    The width of the image to retrieve. If this is larger than the images maximum width, the maximum width will be used.

    Return Value

    A URL for the specified width.