MCPcopy Create free account
hub / github.com/devforth/painterro / setActiveColor

Method setActiveColor

js/colorPicker.js:252–282  ·  view source on GitHub ↗
(color, ignoreUpdateText)

Source from the content-addressed store, hash-verified

250 }
251
252 setActiveColor(color, ignoreUpdateText) {
253 try {
254 this.input.style.color = reversedColor(color);
255 } catch (e) {
256 return;
257 }
258 this.input.style['background-color'] = color;
259 if (ignoreUpdateText === undefined) {
260 this.input.value = color;
261 }
262 this.color = color;
263 this.alphaColor = HexToRGBA(color, this.alpha);
264 if (this.callback !== undefined && this.opened) {
265 this.callback({
266 alphaColor: this.alphaColor,
267 lightPosition: this.lightPosition,
268 alpha: this.alpha,
269 palleteColor: this.color,
270 target: this.target,
271 });
272 }
273 if (this.addCallback !== undefined && this.opened) {
274 this.addCallback({
275 alphaColor: this.alphaColor,
276 lightPosition: this.lightPosition,
277 alpha: this.alpha,
278 palleteColor: this.color,
279 target: this.target,
280 });
281 }
282 }
283
284 static html() {
285 return '' +

Callers 3

constructorMethod · 0.95
regetColorMethod · 0.95
regetAlphaMethod · 0.95

Calls 2

reversedColorFunction · 0.85
HexToRGBAFunction · 0.85

Tested by

no test coverage detected