Led Server Utilities
Moved some utility function (interpolations & blendings) from JavaScript to a node native add-on (which will hopefully speed up some of the calculations of the LED server that happen pretty often).
Functions
interpolatePixels
- interpolates between two colors - don't use this in practice, it's slower than the JS/TS equivalentinterpolateTwoLayers
- interpolates two layers pixel by pixelapplyKernelToLayer
- applies a kernel to a layerdimLayer
- dims a layerblendPixels
- blends an array of pixelsblendTwoPixels
- blends two colorsblendLayers
- blends an array of layers pixel by pixel
Interpolations
Linear
EaseIn
EaseOut
EaseInOut
Blend Modes
Add
, Subtract
, Multiply
, Screen
, Overlay
,
HardLight
, SoftLight
, Divide
, Difference
,
Darken
, Lighten
, Replace
, Dissolve
Examples
const white = r: 1 g: 1 b: 1 n: 1;const black = r: 0 g: 0 b: 0 n: 1;const red = r: 1 g: 0 b: 0 n: 1;const green = r: 0 g: 1 b: 0 n: 1; ;;; ;;;;; ;;;; ;; ;;;