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:
slug
andcolor
must 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) |
-- |
.svg
is 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-icons
package - Parses color with
tinycolor2.toHex8String()
, into a validhex8
(or#000000ff
) - CSS named colors (such as
slategray
orrebeccapurple
) 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.git
git checkout -b feat/feature-name
pnpm install
yarn install
npm install
gh 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