UNPKG

on-codemerge

Version:

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product

2 lines (1 loc) 620 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=["#3b82f6","#ef4444","#10b981","#f59e0b","#6366f1","#ec4899","#8b5cf6","#14b8a6","#f97316","#06b6d4"];function a(){return n[Math.floor(Math.random()*n.length)]}function f(t,r){if(t||(t=a()),t.startsWith("#")){const e=parseInt(t.slice(1,3),16),s=parseInt(t.slice(3,5),16),i=parseInt(t.slice(5,7),16);return`rgba(${e}, ${s}, ${i}, ${r})`}if(t.startsWith("rgb")){const e=t.match(/\d+/g);return!e||e.length<3?t:`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${r})`}return t}exports.CHART_COLORS=n;exports.colorWithOpacity=f;exports.getRandomColor=a;