Initializerswift-png 4.4.5PNG
init(name:entries:)
Creates a suggested palette.
PNG.SuggestedPalette.swift:29init(name: String, entries: Entries)
Parameters
- name
The palette name.
This string must contain only unicode scalars in the ranges
"\u{20}" ... "\u{7d}"
or"\u{a1}" ... "\u{ff}"
. Leading, trailing, and consecutive spaces are not allowed. Passing an invalid string will result in a precondition failure.- entries
A variant array of palette colors and frequencies.
Other members in extension
Types
enum Entries
A variant array of palette colors and frequencies.
Type members
init(parsing: [UInt8]
) throws Creates a suggested palette by parsing the given chunk data.
Instance members
var entries: Entries
The colors in this suggested palette, and their frequencies.
let name: String
The name of this suggested palette.
var serialized: [UInt8]
Encodes this suggested palette as the contents of an
sPLT
chunk.