MCPcopy
hub / github.com/adobe-webplatform/Snap.svg / packageRGB

Function packageRGB

src/svg.js:738–752  ·  view source on GitHub ↗
(r, g, b, o)

Source from the content-addressed store, hash-verified

736 return [r, g, b];
737},
738packageRGB = function (r, g, b, o) {
739 r = math.round(r * 255);
740 g = math.round(g * 255);
741 b = math.round(b * 255);
742 var rgb = {
743 r: r,
744 g: g,
745 b: b,
746 opacity: is(o, "finite") ? o : 1,
747 hex: Snap.rgb(r, g, b),
748 toString: rgbtoString
749 };
750 is(o, "finite") && (rgb.opacity = o);
751 return rgb;
752};
753/*\
754 * Snap.color
755 [ method ]

Callers 1

svg.jsFile · 0.70

Calls 1

isFunction · 0.70

Tested by

no test coverage detected