We also use a project called ImageProcessingLibrary
for generating moving images. It consists of several utility classes facilitating changing and retrieving colors:
DoubleColor
is a central class within the project. It contains information about R, G, B, and A bytes of a color using double precision variables (instead of bytes) to store them. Having these values stored as doubles makes it easier to manipulate them. The class also provides conversion functions between itself and theSystem.Windows.Media.Color
class. It also provides a function to convert an object of theDoubleColor
type toint
.The
ColorUtils
class provides a bunch of extension methods facilitating changing colors (adding two colors, multiplying a color by a scalar, blending two colors, and so on).The
ColorMap
class provides a way to set a map between the colors we want to use and real numbers from within the 0 to 1 range.