Interfaces

The RGBColor, HSVColor, and Vector3 interfaces are used throughout the curves module to work with colors and three-dimensional vector quantities.

RGBColor

The RGBColor interface is used in RGBColor keyframes, curves, and modifiers. It refers to any object with an r value, a g value, and a b value, used to reference a color’s RGB code.


import { RGBColor } from 'curves'; // Import

// Example
const color: RGBColor = {
    r: 32,       // Between 0 - 255
    g: 240,      // Between 0 - 255
    b: 120,      // Between 0 - 255
}

HSVColor

The HSVColor interface is used in HSVColor keyframes, curves, and modifiers. It refers to any object with an h value, a s value, and a v value, used to reference a color’s HSV code.

You can convert HSV values to HSL values and vice versa using the ColorHelper.

import { HSVColor } from 'curves'; // Import

// Example
const color: HSVColor = {
    h: 280,      // Between 0 - 360
    s: 40,       // Between 0 - 100
    v: 100,      // Between 0 - 100
}

Vector3

The Vector3 interface is used in Vector3 keyframes, curves, and modifiers. It refers to any object with an x value, a y value, and a z value, used to reference a position, rotation, scale, or any other 3-dimensional vector quantities.


import { Vector3 } from 'curves'; // Import

// Example
const position: Vector3 = {
    x: 10,
    y: 32,
    z: 100,
}