New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

favicolor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

favicolor

Set a page's favicon to a solid color

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

favicolor

Set a page's favicon to a solid color. favicolor.ima.computer

Travis CI Build Status Dependency Status

NPM Module

Browser support

Example

var favicolor = require('favicolor');
var icon = document.querySelector('[rel=icon]');
favicolor(icon, 'red');

Install

With npm do:

$ npm install favicolor

favicolor 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/favicolor@latest"></script>

Usage

var favicolor = require('favicolor');

favicolor(icon, colorString)

favicolor(icon, rgbArray)

favicolor(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:

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

Keywords

FAQs

Package last updated on 12 Apr 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc