Goonstation 13 - Modules - Types

_std/color.dm

/proc/mult_color_matrix Takes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list
/proc/normalize_color_to_matrix Takes a possible value of the color var and returns a length 20 color matrix doing the same thing. Available inputs: null, "#rgb", "#rrggbb", "#rgba", "#rrggbbaa", all forms of color matrices
/proc/color_mapping_matrix Takes two lists, inp=list(i1, i2, i3), out=(o1, o2, o3). Creates a color matrix which maps color i1 to o2, i2 to o2, i3 to o3. (Ignores alpha values.) Keep the i1, i2, i3 vectors linearly independent. The colors can be either be color hex strings or lists as returned from hex_to_rgb_list. You need to supply all arguments. If you don't care about the third just set i3 = o3 to something linearly independent of i1 and i2.
/proc/affine_color_mapping_matrix The same thing as [proc/color_mapping_matrix] but with 4 mapped colors. The first color is used as the origin in the affine transform.
/proc/hsv_transform_color_matrix Generates a color matrix which performs an approximation of the HSV-space transform. Hue is in degrees and is applied additively. Saturation is in a 0-1 range and is applied multiplicatively. Value is in a 0-1 range and is applied multiplicatively.