The icons SDK provides various ways of rendering icons, it is primarily intended for internal use. Most of this is called via the koicon:// protocol
Methods
-
require("ko/icons").createPngFromSvg(svgPath, savePath, opts, attrs, callback)
-
If using a custom size it assumes the following:
- Svg has a root <svg> element with the attributes "width" and "height"
- Both width and height use the same value (ie. svg canvas is square)
- the root <svg> element is not using a transform attribute
Parameters:
Name Type Description svgPath
String Path of the .svg
savePath
String Path where .png is saved
opts
Object {delete: boolean} Delete the .svg when done
attrs
Object Forced attributes, use "size" instead of width/height (if width and height are the same)
callback
function Function to call when done
-
require("ko/icons").getIconForUri(uri, callback)
-
Get the file icon for the given URI
Parameters:
Name Type Description uri
String URI
callback
function Callback function