Socket
Socket
Sign inDemoInstall

favicon-color

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    favicon-color

Set a page's favicon to a solid color


Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Install size
22.6 kB
Created
Weekly downloads
 

Readme

Source

favicon-color

Set a page's favicon to a solid color

Travis CI Build Status Dependency Status

NPM Module

Browser support

Example

var colorize = require('favicon-color');
var icon = document.querySelector('[rel=icon]');
colorize(icon, 'red');

Install

With npm do:

$ npm install favicon-color

favicon-color is designed to work in the browser via a bundlers such as browserify and as a stand-alone script:

<script src="http://wzrd.in/standalone/favicon-color@latest"></script>

Usage

var colorize = require('favicon-color');

colorize(icon, red, green, blue)

icon is the favicon DOM element. The color can be specified by passing the RGB values as individual arguments, by passing an array containing the RGB values as the second argument, or by passing a string as the second argument. In the latter case you are free to use any valid color string, e.g. 'red', '#ff0000', 'rgb(255, 0, 0)', etc. Note: This method temporarily removes the specified element to work around a quirk in Firefox.

Examples:

colorize(icon, 68, 68, 68);
colorize(icon, [13, 37, 42]);
colorize(icon, 'cyan');
colorize(icon, '#bada55');
colorize(icon, 'hsla(170, 50%, 45%, 1)');

Keywords

FAQs

Last updated on 23 Aug 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc