GridCraft.Icon

Icons etc

API Overview #

API Documentation #

Deprecateds #

macFile #

SignatureGridCraft.Icon.macFile(filePath) -> string or nil
TypeDeprecated
Description

Use fromMacIcon() instead.

Functions #

phosphor #

SignatureGridCraft.Icon.phosphor(name, [weight]) -> string or nil
TypeFunction
Description

Create an icon from a Phosphor icon name and weight

Parameters
  • name - The name of the Phosphor icon (e.g., “app-window”)
  • weight - The weight of the icon (e.g., “regular”, “bold”, “duotone”). Defaults to “regular”.

fromMacIcon #

SignatureGridCraft.Icon.fromMacIcon(filePath) -> string or nil
TypeFunction
Description

Create an icon from the icon of a macOS file (including folders, applications, etc)

Parameters
  • filePath - The path to the file or application for which to get the icon

fileContents #

SignatureGridCraft.Icon.fileContents(filePath) -> string or nil
TypeFunction
Description

Create an icon from the contents of a file

Parameters
  • filePath - The path to the file to read
  • fileType - The MIME type of the file, like “image/png” or “image/svg+xml”
Returns
  • string containing a data URI with base64-encoded data of the file

empty #

SignatureGridCraft.Icon.empty() -> string
TypeFunction
Description

Create an empty icon, which is a transparent PNG image

Parameters
  • None
Returns
  • string containing an img tag with the transparent PNG data