This has been pretty useful to me, so I figured I might as well post it:
I made a function to generate a clean-looking icon for a project -
function makeIcon(name, description, col, mfont)
local size = 120
local im = image(size, size)
setContext(im)
background(255)
stroke(0)
fill(col or color(127, 127, 127, 255))
strokeWidth(1)
noSmooth()
textMode(CORNER)
font(mfont or "HelveticaNeue-Bold")
fontSize(32 * size / 256)
textWrapWidth(size - 10)
local w, h = textSize(name)
text(name, 5, size - 5 - h)
if description then
if description == "LIBRARY" then
fill(127,127,255)
else
fill(255, 127, 127)
end
text(description, 5, 5)
end
setContext()
return im
end
To use it, just add this line to your program:
saveImage( "Project:Icon", makeIcon("Title", "DESCRIPTION") )
You can also alter the color and font of the image, by adding more arguments.
saveImage( "Project:Icon", makeIcon("Title", "DESCRIPTION", TITLE_COLOR, "Font-Name") )
It results in icons like these