soegaard2
2021-6-6 16:39:17

Is this correct? “Calculates a color between two colors at a specific increment.”

I find this usage of the word “increment” a bit odd.


massung
2021-6-6 17:01:31

Not sure what the context is. I would agree with your assessment of the word “increment” though.

My experience is that functions with docs like you’re describing are usually something like:

(define (gradient from to [pct 0.5]) ...)


massung
2021-6-6 17:02:14

So the argument would be a percent or fraction, where 0 = from and 1 = to.


massung
2021-6-6 17:04:14

The exception to that would be if trying to find a palette color opposite the two inputs (ie on a color wheel, a color that would make a triangle opposite the center between the inputs), but that wouldn’t need an increment or fraction either.


soegaard2
2021-6-6 17:04:56

It’s taken from the docs of Processing: https://processing.org/reference/lerpColor_.html


soegaard2
2021-6-6 17:05:50

Your interpretation is spot on. I just wondered whether “increment” could be used in other ways than “something to be added”.


massung
2021-6-6 17:15:33

Not with respect to any linear interpolation that I’m aware of ;)


massung
2021-6-6 17:16:32

Perhaps they mean it as a synonym to “step”, where 1.0 would be the full step to the next color (second input)?


soegaard2
2021-6-6 17:17:05

Could be. I’ll file a bug report and see what they say.


soegaard2
2021-6-6 17:17:58

I have noticed that they use “friendly” language in some places in order to make the documentation easier to read - but it tends to confuse me.


soegaard2
2021-6-6 17:18:04

I am spoiled by the Racket docs.


jcoo092
2021-6-6 22:36:01

If you have discrete steps, then yes “increment” could potentially refer to one of them.

Looking at the referenced page, however, it does seem like a slightly weird way to word it. Unless that’s standard usage throughout Processing.


jorge.garcia.gonzalez
2021-6-6 23:57:27

@jorge.garcia.gonzalez has joined the channel