def colorText(text, color): """Applies the color (string or int) to text and returns the resulting string.""" if text is not None and color is not None: if isinstance(color, types.StringTypes): color = ColorUtil.keyToType(color) if color >= 0: return localText.changeTextColor(text, color) return text
def getColor(self, *args): """Returns the value as a color type (int) if this is a color or string option, the actual value if an int, or -1 otherwise. """ if self.isColor() or self.isString(): return ColorUtil.keyToType(self.getValue(*args)) elif self.isInt(): return self.getValue(*args) return -1
def getColor(self, *args): """Returns the value as a color type (int) if this is a color or string option, the actual value if an int, or -1 otherwise. """ if self.isColor() or self.isString(): return ColorUtil.keyToType(self.getValue(*args)) elif self.isInt(): return self.getValue(*args) return -1
def colorText(text, color): """ Applies the color (string or int) to text and returns the resulting string. """ if text is not None and color is not None: if isinstance(color, types.StringTypes): color = ColorUtil.keyToType(color) if color >= 0: return localText.changeTextColor(text, color) return text