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.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Colour RGBA

NPM version Coverage Status Known Vulnerabilities Downloads Install Size Contributors Pull Requests Welcome

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

Usage

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

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

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

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

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

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

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

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

Installation

To install this module:

npm install colour-rgba

Keywords

FAQs

Package last updated on 28 Apr 2023

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