2.1k simpleicons · dynamic color API · vercel edge CDN
There are two different schemas that icns.ml (and icns.cf) is designed to work with:
https://icns.{ml,cf} / slug* — color . type†
Note:
slugandcolormust be separated by a hyphen (dash).
https://icns.{ml,cf} / color / slug* . type†
| Parameter | Usage | Syntax | More Information |
|---|---|---|---|
slug* |
required | Alphanumeric; No hyphens, punctuation, etc. | Naming Convention ↗ |
color |
optional | CSS colors; Hexadecimal (3/4/6/8), names, rgb, hsl, ... | Dynamic Color API |
type† |
advised | .svg (raster support for .png coming soon) |
-- |
.svgis the fallback/implicit filetype (e.g. https://icns.ml/google -> https://icns.ml/google.svg)
The color parameter in the accepted URL schemas (both nested and linear/flat) is interpreted using tinycolor2.
With the goal of maximum compatibility, I've attempted to make the API as forgiving as possible:
- Reversed color and slug params will usually still resolve correctly...
- Default color is the icon's brand color specified by the
simple-iconspackage - Parses color with
tinycolor2.toHex8String(), into a validhex8(or#000000ff) - CSS named colors (such as
slategrayorrebeccapurple) are supported - RGB/RGBA colors are supported
- HSL/HSV colors are supported, but experimental
You may be used to seeing hexadecimal colors only in 3 or 6 digit formats. The extra digit in Hex4 and the 2 extra digits in Hex8 are an alpha channel, which allows users to control the opacity levels of the color in question.
icns.ml supports Hex 3/4/6/8, as defined in the MDN Web Docs, meaning it supports transparency!
# GitHub CLI (https://cli.github.com)
gh repo clone nberlette/icns
# ...or with standard Git
git clone https://github.com/nberlette/icns.gitgit checkout -b feat/feature-namepnpm install
yarn install
npm installgh pr create --title "My new feature for icns.ml" Found a bug? Please open an issue on the repository.
MIT © Nicholas Berlette • Icons copyright SimpleIcons • deployed with Vercel