var returns = "org.eclipse.swt.graphics.RGB"; var description = "PANDA Temperature Colour Rules"; var parameters = new Array("VAL", "HIHI", "LOLO", "HIGH", "LOW", "Default Colour"); var RED = new Packages.org.eclipse.swt.graphics.RGB(0,1,1); var YELLOW = new Packages.org.eclipse.swt.graphics.RGB(60,1,1); var GREEN = new Packages.org.eclipse.swt.graphics.RGB(120,1,1); var BLACK = new Packages.org.eclipse.swt.graphics.RGB(0,0,0); function execute (args) { var valu = args[0]; var hihi = args[1]; var lolo = args[2]; var high = args[3]; var low = args[4]; var colour = args[5]; if ((valu < low) && (valu > lolo)) { return GREEN; } if (valu < lolo) { return BLACK; } if ((valu > high) && (valu < hihi)) { return YELLOW; } if (valu > hihi) { return RED; } return colour; }