xcassets

package
v0.0.0-...-e51055f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Iphone contains all the required icon sizes for an iPhone app
	Iphone = []Image{
		{
			Size:     "29x29",
			Idiom:    "iphone",
			Filename: "Icon29.png",
			Scale:    "1x",
		},
		{
			Size:     "29x29",
			Idiom:    "iphone",
			Filename: "Icon58.png",
			Scale:    "2x",
		},
		{
			Size:     "29x29",
			Idiom:    "iphone",
			Filename: "Icon87.png",
			Scale:    "3x"},
		{
			Size:     "40x40",
			Idiom:    "iphone",
			Filename: "Icon80.png",
			Scale:    "2x",
		},
		{
			Size:     "40x40",
			Idiom:    "iphone",
			Filename: "Icon120.png",
			Scale:    "3x"},
		{
			Size:     "57x57",
			Idiom:    "iphone",
			Filename: "Icon57.png",
			Scale:    "1x"},
		{
			Size:     "57x57",
			Idiom:    "iphone",
			Filename: "Icon114.png",
			Scale:    "2x"},
		{
			Size:     "60x60",
			Idiom:    "iphone",
			Filename: "Icon120.png",
			Scale:    "2x"},
		{
			Size:     "60x60",
			Idiom:    "iphone",
			Filename: "Icon180.png",
			Scale:    "3x"},
	}
	//Ipad contains all the required icon sizes for an iPad app
	Ipad = []Image{
		{
			Size:     "29x29",
			Idiom:    "ipad",
			Filename: "Icon29.png",
			Scale:    "1x"},
		{
			Size:     "29x29",
			Idiom:    "ipad",
			Filename: "Icon58.png",
			Scale:    "2x"},
		{
			Size:     "40x40",
			Idiom:    "ipad",
			Filename: "Icon40.png",
			Scale:    "1x"},
		{
			Size:     "40x40",
			Idiom:    "ipad",
			Filename: "Icon80.png",
			Scale:    "2x"},
		{
			Size:     "50x50",
			Idiom:    "ipad",
			Filename: "Icon50.png",
			Scale:    "1x"},
		{
			Size:     "50x50",
			Idiom:    "ipad",
			Filename: "Icon100.png",
			Scale:    "2x"},
		{
			Size:     "72x72",
			Idiom:    "ipad",
			Filename: "Icon72.png",
			Scale:    "1x"},
		{
			Size:     "72x72",
			Idiom:    "ipad",
			Filename: "Icon144.png",
			Scale:    "2x"},
		{
			Size:     "76x76",
			Idiom:    "ipad",
			Filename: "Icon76.png",
			Scale:    "1x"},
		{
			Size:     "76x76",
			Idiom:    "ipad",
			Filename: "Icon152.png",
			Scale:    "2x"},
	}
	//Mac contains all the required icon sizes for a Mac app.
	Mac = []Image{
		{
			Size:     "16x16",
			Idiom:    "mac",
			Filename: "Icon16.png",
			Scale:    "1x"},
		{
			Size:     "16x16",
			Idiom:    "mac",
			Filename: "Icon32.png",
			Scale:    "2x"},
		{
			Size:     "32x32",
			Idiom:    "mac",
			Filename: "Icon32.png",
			Scale:    "1x"},
		{
			Size:     "32x32",
			Idiom:    "mac",
			Filename: "Icon64.png",
			Scale:    "2x"},
		{
			Size:     "128x128",
			Idiom:    "mac",
			Filename: "Icon128.png",
			Scale:    "1x"},
		{
			Size:     "128x128",
			Idiom:    "mac",
			Filename: "Icon256.png",
			Scale:    "2x"},
		{
			Size:     "256x256",
			Idiom:    "mac",
			Filename: "Icon256.png",
			Scale:    "1x"},
		{
			Size:     "256x256",
			Idiom:    "mac",
			Filename: "Icon512.png",
			Scale:    "2x"},
		{
			Size:     "512x512",
			Idiom:    "mac",
			Filename: "Icon512.png",
			Scale:    "1x"},
		{
			Size:     "512x512",
			Idiom:    "mac",
			Filename: "Icon1024.png",
			Scale:    "2x"},
	}
	//IOS = iphone, ipad
	IOS = append(Iphone, Ipad...)
	//All is a preset containing every possible icon size.
	All = append(IOS, Mac...)
)
View Source
var LaunchImages = []Image{
	{
		Orientation:          "portrait",
		Idiom:                "iphone",
		Extent:               "full-screen",
		MinimumSystemVersion: "7.0",
		Filename:             "smallsplash.png",
		Scale:                "2x",
	},
	{
		Extent:               "full-screen",
		Idiom:                "iphone",
		Subtype:              "retina4",
		Filename:             "big_splash.png",
		MinimumSystemVersion: "7.0",
		Orientation:          "portrait",
		Scale:                "2x",
	},
	{
		Orientation:          "portrait",
		Idiom:                "ipad",
		Extent:               "full-screen",
		MinimumSystemVersion: "7.0",
		Scale:                "1x",
	},
	{
		Orientation:          "landscape",
		Idiom:                "ipad",
		Extent:               "full-screen",
		MinimumSystemVersion: "7.0",
		Scale:                "1x",
	},
	{
		Orientation:          "portrait",
		Idiom:                "ipad",
		Extent:               "full-screen",
		MinimumSystemVersion: "7.0",
		Scale:                "2x",
	},
	{
		Orientation:          "landscape",
		Idiom:                "ipad",
		Extent:               "full-screen",
		MinimumSystemVersion: "7.0",
		Scale:                "2x",
	},
	{
		Orientation: "portrait",
		Idiom:       "iphone",
		Extent:      "full-screen",
		Filename:    "Default.png",
		Scale:       "1x",
	},
	{
		Orientation: "portrait",
		Idiom:       "iphone",
		Extent:      "full-screen",
		Filename:    "Default@2x.png",
		Scale:       "2x",
	},
	{
		Orientation: "portrait",
		Idiom:       "iphone",
		Extent:      "full-screen",
		Filename:    "Default-568h@2x.png",
		Subtype:     "retina4",
		Scale:       "2x",
	},
	{
		Orientation: "portrait",
		Idiom:       "ipad",
		Extent:      "to-status-bar",
		Scale:       "1x",
	},
	{
		Orientation: "landscape",
		Idiom:       "ipad",
		Extent:      "to-status-bar",
		Scale:       "1x",
	},
	{
		Orientation: "portrait",
		Idiom:       "ipad",
		Extent:      "to-status-bar",
		Scale:       "2x",
	},
	{
		Orientation: "landscape",
		Idiom:       "ipad",
		Extent:      "to-status-bar",
		Scale:       "2x",
	},
}

LaunchImages are presets for iPhone/iPad launch images.

Functions

func FindPath

func FindPath(root, target string) (occurrences []string, err error)

func GenerateAppIconSet

func GenerateAppIconSet(source, dest string, targets []Image) error

GenerateAppIconSet takes a source file and a dest Images.xcassets filepath, and overwrites the containing AppIcon.appiconset with a new one containing all the image formats in targets.

Types

type Contents

type Contents struct {
	Images []Image `json:"images"`
	Info   Info    `json:"info"`
}

Contents represents a Contents.json file.

func NewContents

func NewContents() Contents

NewContents creates a new Contents, containing no images.

type Image

type Image struct {
	Size                 string `json:"size"`
	Idiom                string `json:"idiom"`
	Filename             string `json:"filename"`
	Scale                string `json:"scale"`
	Subtype              string `json:"subtype,omitempty"`
	Extent               string `json:"extent,omitempty"`
	MinimumSystemVersion string `json:"minimum-system-version,omitempty"`
	Orientation          string `json:"orientation,omitempty"`
}

Image is a particular image within an image set.

func (Image) Px

func (i Image) Px() uint

Px returns the dimensions in pixels of this image.

type Info

type Info struct {
	Version int    `json:"version"`
	Author  string `json:"author"`
}

Info contains metadata about this image set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL