1.0.1 • Published 1 year ago

maxwell-triangle v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

maxwell-triangle

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Get color values inside a Maxwell triangle from positions and vice versa.

paypal coinbase twitter

npm.io

Installation

npm install maxwell-triangle

Usage

import MaxwellTriangle from "maxwell-triangle";

const maxwellTriangle = new MaxwellTriangle(512);

// Get the value at the bottom center of the triangle
const value = maxwellTriangle.getValue(256, 512);

API

MaxwellTriangle

Create a Maxwell Triangle

Kind: global class

maxwellTriangle.getValue(x, y) ⇒ Array.<number>

Get a r, g, b value at x/y position in the given size

Kind: instance method of MaxwellTriangle

ParamType
xnumber
ynumber

maxwellTriangle.getPoint(r, g, b) ⇒ Array.<number>

Get a x/y position from r, g, b values

Kind: instance method of MaxwellTriangle

ParamType
rnumber
gnumber
bnumber

License

MIT. See license file.

1.0.1

1 year ago

1.0.0

1 year ago