MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / getColor

Function getColor

src/scripting/Unpacker.js:47–59  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

45 /** Load the text **/
46 this.DOM.appendChild(document.createTextNode(data.text));
47 var getColor = function(c){
48 if(typeof c === "string"){
49 c = parseInt(c);
50 if(c === NaN){
51 c = 0;
52 }
53 }
54 var color = c.toString(16);
55 while(color.length < 6){
56 color = "0" + color;
57 }
58 return "#" + color;
59 };
60 this.setTextFormat = function(textFormat){
61 this.DOM.style.fontFamily = textFormat.font;
62 this.DOM.style.fontSize = textFormat.size + "px";

Callers 1

Unpacker.jsFile · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected