Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colour-rgba

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colour-rgba

A module for creating RGBA Colour objects and manipulating, un/packing and de/serializing them.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Colour RGBA

NPM version Build Status Coverage Status Known Vulnerabilities Downloads

A module for creating RGBA Colour objects and manipulating, un/packing and de/serializing them.

Usage

var Colour = require("colour-rgba");

// create a new colour
var myColour = new Colour(86, 75, 30, 99);

// or use a pre-defined colour
var red = Colour.LimeGreen;

// convert a colour to an array excluding the alpha channel
var colourArray = myColour.toArray(false);

// pack a colour object into a 32-bit number
var packedNumber = myColour.pack();

// unpack a colour from a 32-bit number
var unpackedColour = Colour.unpack(packedNumber);

// serialize a colour object into a buffer and include the alpha channel
var serializedColour = myColour.serialize(true);

// de-serialize a colour object from a buffer
var deserializedColour = Colour.deserialize(serializedColour);

Installation

To install this module:

npm install colour-rgba

Keywords

FAQs

Package last updated on 05 May 2019

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