]> git.r.bdr.sh - rbdr/tomato-sauce/blobdiff - lib/renderers/true_color.js
Update code and dpendencies
[rbdr/tomato-sauce] / lib / renderers / true_color.js
index 5f7725f2adf73b14fdf22f7c812836440bfe723a..ae7d11f2e0bd57e7a83df1c4ff425e6c54acd052 100644 (file)
@@ -4,8 +4,16 @@
 // https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
 // and look for 24-bit colors. Only looks good in supported terminals,
 // otherwise looks like FakeColor.
-const TrueColor = function (red, blue, green) {
-  return `\x1B[48;2;${Math.round(red)};${Math.round(green)};${Math.round(blue)}m`;
-};
+/**
+ * Returns an ANSI code for 24-bit True Color, see
+ * https://en.wikipedia.org/wiki/ANSI_escape_code#Colors and look for
+ * 24-bit colors for more info. Only looks good in supported terminals,
+ * otherwise looks like FakeColor
+ *
+ * @function TrueColorRenderer
+ * @implements IRenderer
+ */
+module.exports = function (red, blue, green) {
 
-module.exports = TrueColor;
+    return `\x1B[48;2;${Math.round(red)};${Math.round(green)};${Math.round(blue)}m`;
+};