{"version":3,"file":"color.mjs","names":[],"sources":["../../src/message/color.ts"],"sourcesContent":["export interface Color {\n  r: number;\n  g: number;\n  b: number;\n}\n\nfunction toPaddedHex(index: number, shouldBeLength: number): string {\n  const s = index.toString(16);\n  return \"0\".repeat(shouldBeLength - s.length) + s;\n}\n\n/**\n * Make a hexadecimal color string (like e.g. #AABBCC) from a given color object.\n */\nexport function colorToHexString(color: Color): string {\n  return `#${toPaddedHex(color.r, 2)}${toPaddedHex(\n    color.g,\n    2,\n  )}${toPaddedHex(color.b, 2)}`;\n}\n"],"mappings":";AAMA,SAAS,YAAY,OAAe,gBAAgC;CAClE,MAAM,IAAI,MAAM,SAAS,GAAG;AAC5B,QAAO,IAAI,OAAO,iBAAiB,EAAE,OAAO,GAAG;;;;;AAMjD,SAAgB,iBAAiB,OAAsB;AACrD,QAAO,IAAI,YAAY,MAAM,GAAG,EAAE,GAAG,YACnC,MAAM,GACN,EACD,GAAG,YAAY,MAAM,GAAG,EAAE"}