How to use the chroma-js.temperature function in chroma-js

To help you get started, we’ve selected a few chroma-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mezzario / color-math / src / evaluators / CoreEvaluator.js View on Github external
evalColorByTemperature(node) {
    const temperature = Utils.forceNumInRange(node.value.evaluate(this), 0, 200000, node.value.$loc)
    const value = Chroma.temperature(temperature)

    return value
  }
github mezzario / color-math / src / eval-scope.js View on Github external
CoreEvaluator.prototype.evalManageColorTemperature = function (node) {
        var curValue = node.obj.evaluate(this).temperature();
        if (node.value === void 0)
            return curValue;
        else {
            var value = utils_1.forceType(node.value.evaluate(this), utils_1.ValueType.Number, node.value.$loc);
            if (node.operator)
                value = this.getNumberArithmeticFunc(node.operator)(curValue, value);
            var obj = chroma.temperature(value);
            return obj;
        }
    };
    CoreEvaluator.prototype.evalManageColorLuminance = function (node) {
github mezzario / color-math / src / evaluators / CoreEvaluator.js View on Github external
evalManageColorTemperature(node) {
    const curValue = (node.obj.evaluate(this)).temperature()

    if (node.value === void 0) {
      return curValue
    } else {
      let value = Utils.forceType(node.value.evaluate(this), ValueType.Number, node.value.$loc)
      if (node.operator) {
        value = this._getNumberArithmeticFunc(node.operator)(curValue, value)
      }

      const obj = Chroma.temperature(value)
      return obj
    }
  }
github mezzario / color-math / src / eval-scope.js View on Github external
CoreEvaluator.prototype.evalColorByTemperature = function (node) {
        var temperature = utils_1.forceNumInRange(node.value.evaluate(this), 0, 200000, node.value.$loc);
        var value = chroma.temperature(temperature);
        return value;
    };
    CoreEvaluator.prototype.evalColorByWavelength = function (node) {