mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Ugh
This commit is contained in:
@@ -642,4 +642,20 @@ world
|
||||
//Images have dir without being an atom, so they get their own definition.
|
||||
//Lame.
|
||||
/image/proc/setDir(newdir)
|
||||
dir = newdir
|
||||
dir = newdir
|
||||
|
||||
/* Gives the result RGB of a RGB string after a matrix transformation. No alpha.
|
||||
* Input: rr, rg, rb, gr, gg, gb, br, bg, bb, cr, cg, cb
|
||||
* Output: RGB string
|
||||
*/
|
||||
/proc/RGBMatrixTransform(list/color, list/cm)
|
||||
ASSERT(cm.len >= 9)
|
||||
if(cm.len < 12) // fill in the rest
|
||||
for(var/i in 1 to (12 - cm.len))
|
||||
cm += 0
|
||||
if(!islist(color))
|
||||
color = ReadRGB(color)
|
||||
color[1] = color[1] * cm[1] + color[2] * cm[2] + color[3] * cm[3] + cm[10] * 255
|
||||
color[2] = color[1] * cm[4] + color[2] * cm[5] + color[3] * cm[6] + cm[11] * 255
|
||||
color[3] = color[1] * cm[7] + color[2] * cm[8] + color[3] * cm[9] + cm[12] * 255
|
||||
return rgb(color[1], color[2], color[3])
|
||||
Reference in New Issue
Block a user