JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q36250F
  • License ISC

A super lightweight library for setting the highlights, midtones and shadows for images drawn on HTML5 Canvas.

Package Exports

  • canvas-hms

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (canvas-hms) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

canvas-hms

A super lightweight library for setting the highlights, midtones and shadows for images drawn on HTML5 Canvas.

Install

npm install canvas-hms

Import

ES6/Babel

import HMS from "canvas-hms";

ES5

const HMS = require("canvas-hms");

Usage

// Do some canvas magic...
context.drawImage(myImage, 0, 0, canvas.width, canvas.height);

const options = {curveWidth: 765 / 3};
const hms = new HMS({canvas: myCanvasElement, options});

// Values inbetween -50 and +50
hms.setHighlights(20);
hms.setMidtones(10);
hms.setShadows(-15);
hms.setTemperature(10);

Before

Before filter

After

After filter