chickadee » sdl2 » colour-scale!

color-scale color factorprocedure
colour-scale color factorprocedure
color-scale! color factor #!optional destprocedure
colour-scale! color factor #!optional destprocedure

Efficiently multiply the RGBA values of color by factor (a float or integer). E.g. factor 0.5 halves the RGBA values, factor 2.0 doubles the values.

  • color-scale and colour-scale return a new managed sdl2:color.
  • color-scale! and colour-scale! modify and return dest. If dest is omitted, color is modified and returned.

These procedures are available in sdl2 egg version 0.2.0 and higher.

The results are clamped to the range [0, 255]. sdl2:color can only hold integer values, so the results will be truncated to integers.