From 14ca396af092674ec35b04a8da097e2b223d4de6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 18 Jan 2023 15:06:08 +0100 Subject: [PATCH] feat(extras): added prism.js themes --- extras/prism/tokyonight_day.js | 76 +++++++++++++++++++++++++++ extras/prism/tokyonight_moon.js | 76 +++++++++++++++++++++++++++ extras/prism/tokyonight_night.js | 76 +++++++++++++++++++++++++++ extras/prism/tokyonight_storm.js | 76 +++++++++++++++++++++++++++ lua/tokyonight/extra/init.lua | 2 + lua/tokyonight/extra/prism.lua | 89 ++++++++++++++++++++++++++++++++ 6 files changed, 395 insertions(+) create mode 100644 extras/prism/tokyonight_day.js create mode 100644 extras/prism/tokyonight_moon.js create mode 100644 extras/prism/tokyonight_night.js create mode 100644 extras/prism/tokyonight_storm.js create mode 100644 lua/tokyonight/extra/prism.lua diff --git a/extras/prism/tokyonight_day.js b/extras/prism/tokyonight_day.js new file mode 100644 index 0000000..2767694 --- /dev/null +++ b/extras/prism/tokyonight_day.js @@ -0,0 +1,76 @@ +module.exports = { + plain: { + color: "#3760bf", + backgroundColor: "#e1e2e7", + }, + styles: [ + { + types: ["prolog", "builtin"], + style: { + color: "#f52a65", + }, + }, + { + types: ["function"], + style: { + color: "#2e7de9", + }, + }, + { + types: ["symbol"], + style: { + color: "#188092", + }, + }, + { + types: ["punctuation"], + style: { + color: "#9854f1", + }, + }, + { + types: ["string", "char", "tag", "selector"], + style: { + color: "#587539", + }, + }, + { + types: ["keyword"], + style: { + color: "#9854f1", + fontStyle: "italic", + }, + }, + { + types: ["operator"], + style: { + color: "#006a83", + }, + }, + { + types: ["constant", "boolean"], + style: { + color: "#b15c00", + }, + }, + { + types: ["variable"], + style: { + color: "#3760bf", + }, + }, + { + types: ["comment"], + style: { + color: "#848cb5", + fontStyle: "italic", + }, + }, + { + types: ["attr-name"], + style: { + color: "rgb(241, 250, 140)", + }, + }, + ], +}; diff --git a/extras/prism/tokyonight_moon.js b/extras/prism/tokyonight_moon.js new file mode 100644 index 0000000..7e8a56f --- /dev/null +++ b/extras/prism/tokyonight_moon.js @@ -0,0 +1,76 @@ +module.exports = { + plain: { + color: "#c8d3f5", + backgroundColor: "#222436", + }, + styles: [ + { + types: ["prolog", "builtin"], + style: { + color: "#ff757f", + }, + }, + { + types: ["function"], + style: { + color: "#82aaff", + }, + }, + { + types: ["symbol"], + style: { + color: "#65bcff", + }, + }, + { + types: ["punctuation"], + style: { + color: "#c099ff", + }, + }, + { + types: ["string", "char", "tag", "selector"], + style: { + color: "#c3e88d", + }, + }, + { + types: ["keyword"], + style: { + color: "#c099ff", + fontStyle: "italic", + }, + }, + { + types: ["operator"], + style: { + color: "#89ddff", + }, + }, + { + types: ["constant", "boolean"], + style: { + color: "#ff966c", + }, + }, + { + types: ["variable"], + style: { + color: "#c8d3f5", + }, + }, + { + types: ["comment"], + style: { + color: "#636da6", + fontStyle: "italic", + }, + }, + { + types: ["attr-name"], + style: { + color: "rgb(241, 250, 140)", + }, + }, + ], +}; diff --git a/extras/prism/tokyonight_night.js b/extras/prism/tokyonight_night.js new file mode 100644 index 0000000..adc9831 --- /dev/null +++ b/extras/prism/tokyonight_night.js @@ -0,0 +1,76 @@ +module.exports = { + plain: { + color: "#c0caf5", + backgroundColor: "#1a1b26", + }, + styles: [ + { + types: ["prolog", "builtin"], + style: { + color: "#f7768e", + }, + }, + { + types: ["function"], + style: { + color: "#7aa2f7", + }, + }, + { + types: ["symbol"], + style: { + color: "#2ac3de", + }, + }, + { + types: ["punctuation"], + style: { + color: "#bb9af7", + }, + }, + { + types: ["string", "char", "tag", "selector"], + style: { + color: "#9ece6a", + }, + }, + { + types: ["keyword"], + style: { + color: "#bb9af7", + fontStyle: "italic", + }, + }, + { + types: ["operator"], + style: { + color: "#89ddff", + }, + }, + { + types: ["constant", "boolean"], + style: { + color: "#ff9e64", + }, + }, + { + types: ["variable"], + style: { + color: "#c0caf5", + }, + }, + { + types: ["comment"], + style: { + color: "#565f89", + fontStyle: "italic", + }, + }, + { + types: ["attr-name"], + style: { + color: "rgb(241, 250, 140)", + }, + }, + ], +}; diff --git a/extras/prism/tokyonight_storm.js b/extras/prism/tokyonight_storm.js new file mode 100644 index 0000000..b44c8a2 --- /dev/null +++ b/extras/prism/tokyonight_storm.js @@ -0,0 +1,76 @@ +module.exports = { + plain: { + color: "#c0caf5", + backgroundColor: "#24283b", + }, + styles: [ + { + types: ["prolog", "builtin"], + style: { + color: "#f7768e", + }, + }, + { + types: ["function"], + style: { + color: "#7aa2f7", + }, + }, + { + types: ["symbol"], + style: { + color: "#2ac3de", + }, + }, + { + types: ["punctuation"], + style: { + color: "#bb9af7", + }, + }, + { + types: ["string", "char", "tag", "selector"], + style: { + color: "#9ece6a", + }, + }, + { + types: ["keyword"], + style: { + color: "#bb9af7", + fontStyle: "italic", + }, + }, + { + types: ["operator"], + style: { + color: "#89ddff", + }, + }, + { + types: ["constant", "boolean"], + style: { + color: "#ff9e64", + }, + }, + { + types: ["variable"], + style: { + color: "#c0caf5", + }, + }, + { + types: ["comment"], + style: { + color: "#565f89", + fontStyle: "italic", + }, + }, + { + types: ["attr-name"], + style: { + color: "rgb(241, 250, 140)", + }, + }, + ], +}; diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index f4b3770..0172c39 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -28,6 +28,7 @@ function M.setup() sublime = "tmTheme", delta = "gitconfig", terminator = "conf", + prism = "js", } -- map of style to style name local styles = { @@ -38,6 +39,7 @@ function M.setup() } for extra, ext in pairs(extras) do + package.loaded["tokyonight.extra." .. extra] = nil local plugin = require("tokyonight.extra." .. extra) for style, style_name in pairs(styles) do config.setup({ style = style }) diff --git a/lua/tokyonight/extra/prism.lua b/lua/tokyonight/extra/prism.lua new file mode 100644 index 0000000..94b89a0 --- /dev/null +++ b/lua/tokyonight/extra/prism.lua @@ -0,0 +1,89 @@ +local util = require("tokyonight.util") + +local M = {} + +--- @param colors ColorScheme +function M.generate(colors) + return util.template(M.template, colors) +end + +M.template = [[ +module.exports = { + plain: { + color: "${fg}", + backgroundColor: "${bg}", + }, + styles: [ + { + types: ["prolog", "builtin"], + style: { + color: "${red}", + }, + }, + { + types: ["function"], + style: { + color: "${blue}", + }, + }, + { + types: ["symbol"], + style: { + color: "${blue1}", + }, + }, + { + types: ["punctuation"], + style: { + color: "${magenta}", + }, + }, + { + types: ["string", "char", "tag", "selector"], + style: { + color: "${green}", + }, + }, + { + types: ["keyword"], + style: { + color: "${magenta}", + fontStyle: "italic", + }, + }, + { + types: ["operator"], + style: { + color: "${blue5}", + }, + }, + { + types: ["constant", "boolean"], + style: { + color: "${orange}", + }, + }, + { + types: ["variable"], + style: { + color: "${fg}", + }, + }, + { + types: ["comment"], + style: { + color: "${comment}", + fontStyle: "italic", + }, + }, + { + types: ["attr-name"], + style: { + color: "rgb(241, 250, 140)", + }, + }, + ], +}; +]] + +return M