Skip to content

Commit c746d33

Browse files
committed
Add example
1 parent c961965 commit c746d33

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,23 @@
22

33
A Go library for adding fancy additions to the filesystem.
44
This is useful for file managers and other tools that have a graphical representation of a users files and folders.
5+
6+
## Example
7+
8+
### Create an overlay image
9+
10+
This `over` image can be placed over a folder or other item indicating the type of content in a fancy folder.
11+
12+
```go
13+
over := &canvas.Image{}
14+
15+
if ff, _ := fancyfs.DetailsForFolder(folderURI); ff != nil {
16+
if ff.BackgroundURI != nil {
17+
over.File = ff.BackgroundURI.Path()
18+
}
19+
if ff.BackgroundResource != nil {
20+
over.Resource = theme.NewColoredResource(ff.BackgroundResource, theme.ColorNameBackground)
21+
}
22+
s.over.FillMode = ff.BackgroundFill
23+
}
24+
```

0 commit comments

Comments
 (0)