commit b2a5cbd896caf2321b9ef1dfe1368876bfaa6e2b
parent 0161855a44415f21c7d8969d701c3ebeb6aaabef
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Tue, 29 Oct 2024 12:07:04 +0800
icns.IconDescription: describe each icon (without icon data)
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/icns.go b/icns.go
@@ -144,6 +144,16 @@ func sizesFrom(max uint) []uint {
return []uint{}
}
+// IconDescription describes an icon.
+type IconDescription struct {
+ OsType
+ ImageFormat
+}
+
+func (desc IconDescription) String() string {
+ return fmt.Sprintf("%s (%s)", desc.OsType, desc.ImageFormat)
+}
+
// ImageFormat specifies the type of image data associated with an icon.
type ImageFormat int
@@ -169,7 +179,7 @@ type OsType struct {
}
func (t OsType) String() string {
- return t.ID
+ return fmt.Sprintf("%s %d", t.ID, t.Size)
}
var osTypes = []OsType{