Skip to content

lerpColor, colorMode(HSB,255), color(x,x,0) #1813

@ducklin5

Description

@ducklin5

I have came to realize that when in colorMode(HSB), colorLerp doesnt work well with color objects that have 0 as an argument.

stroke(255);
// where color doesnt have a zero
var from = color(200, 255, 1);
var to = color(200, 255, 255);
var interA = lerpColor(from, to, .33);
var interB = lerpColor(from, to, .66);
fill(from);
rect(10, 20, 20, 60);
fill(interA);
rect(30, 20, 20, 60);
fill(interB);
rect(50, 20, 20, 60);
fill(to);
rect(70, 20, 20, 60);

//where color has a zerop
var from = color(200, 255, 0);
var to = color(200, 255, 255);
var interA = lerpColor(from, to, .33);
var interB = lerpColor(from, to, .66);
fill(from);
rect(10, 20+90, 20, 60);
fill(interA);
rect(30, 20+90, 20, 60);
fill(interB);
rect(50, 20+90, 20, 60);
fill(to);
rect(70, 20+90, 20, 60);

lerpcolor_vs_zero

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions