Sha256: 22c8bfe4ea9df3244c8aca5cbd5c30bdb383b979325b981c8c71ee91bf8b81e3
Contents?: true
Size: 716 Bytes
Versions: 39
Compression:
Stored size: 716 Bytes
Contents
var utils = require('../utils') , nodes = require('../nodes') , rgba = require('./rgba'); /** * Return a `RGBA` from the r,g,b channels. * * Examples: * * rgb(255,204,0) * // => #ffcc00 * * rgb(#fff) * // => #fff * * @param {Unit|RGBA|HSLA} red * @param {Unit} green * @param {Unit} blue * @return {RGBA} * @api public */ module.exports = function rgb(red, green, blue){ switch (arguments.length) { case 1: utils.assertColor(red); var color = red.rgba; return new nodes.RGBA( color.r , color.g , color.b , 1); default: return rgba( red , green , blue , new nodes.Unit(1)); } };
Version data entries
39 entries across 20 versions & 2 rubygems