├── .github ├── README.md ├── prism.png └── vid.mp4 ├── LICENSE.md └── lua ├── barbecue └── theme │ └── prism.lua ├── lualine └── themes │ └── prism.lua └── prism ├── highlights ├── bufferline.lua ├── cmp.lua ├── devicons.lua ├── diags.lua ├── diff.lua ├── git.lua ├── harpoon.lua ├── hop.lua ├── indentlines.lua ├── normal.lua ├── notify.lua ├── nvimtree.lua ├── telescope.lua ├── ts.lua └── whichkey.lua ├── init.lua ├── picker.lua ├── schemes ├── biscuit.lua ├── camelliahope.lua ├── cat.lua ├── decay.lua ├── dracula.lua ├── everblush.lua ├── everforest.lua ├── ghost.lua ├── gruv.lua ├── nord.lua ├── onedarker.lua ├── oxo.lua ├── rose.lua ├── solarized.lua └── tokyodull.lua ├── themer.lua └── utils.lua /.github/README.md: -------------------------------------------------------------------------------- 1 |
2 | logo 3 |
4 | 5 | ## Install 6 | 7 | Requires [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) 8 | 9 | 10 | - lazy.nvim 11 | 12 | ```lua 13 | { 14 | "chadcat7/prism", 15 | lazy = true, 16 | events = {"UIEnter"}, 17 | config = function() 18 | require("prism"):setup({ 19 | currentTheme = "onedarker", 20 | reset = false, 21 | }) 22 | end 23 | } 24 | ``` 25 | ## Configuration 26 | 27 | ```lua 28 | require("prism"):setup({ 29 | customSchemes = { 30 | -- Add any number of schemes here 31 | { 32 | name = "serenade", 33 | background = "#23282b", 34 | foreground = "#cde5c3", 35 | cursorline = "#272b2f", 36 | comment = "#767b82", 37 | darker = "#1e2124", 38 | cursor = "#bfddb2", 39 | black = "#23282b", -- useful when background is transparent 40 | color0 = "#2E3338", 41 | color1 = "#d76e6e", 42 | color2 = "#ACB765", 43 | color3 = "#e5a46b", 44 | color4 = "#82abbc", 45 | color5 = "#d39bb6", 46 | color6 = "#87c095", 47 | color7 = "#bfddb2", 48 | color8 = "#373D41", 49 | color9 = "#d76e6e", 50 | color10 = "#ACB765", 51 | color11 = "#e5a46b", 52 | color12 = "#82abbc", 53 | color13 = "#d39bb6", 54 | color14 = "#87c095", 55 | color15 = "#cfe0c7", 56 | }, 57 | }, 58 | currentTheme = "serenade", 59 | reset = true, -- applies the currentTheme everytime neovim is opened 60 | -- currentTheme = "onedarker", 61 | customFiles = vim.fn.stdpath "config" .. "/lua/hls", 62 | transparent = false, 63 | reload = { "lualine" }, -- modules to be reloaded everytime theme is set 64 | }) 65 | ``` 66 | - If a theme with the same name is already included in the defaults, theme specified by the user will be given preference 67 | 68 | - For using custom highlights, make files in the `customFiles` folder. For example 69 | 70 | ```lua 71 | -- .config/nvim/lua/hls/alpha.lua 72 | -- you can name the file however you want, because all the files in lua/hls would be read 73 | 74 | local utils = require("prism.utils") 75 | local colors = require("prism.themer"):getColors() 76 | 77 | return { 78 | AlphaHeader = { fg = colors.color4, bg = colors.background }, 79 | AlphaLabel = { fg = colors.color7, bg = colors.background }, 80 | AlphaIcon = { fg = colors.color5, bold = true, }, 81 | AlphaKeyPrefix = { fg = colors.color1, bg = utils.darken(colors.color1, colors.black, 0.04) }, 82 | AlphaMessage = { fg = colors.color2, bg = colors.background }, 83 | AlphaFooter = { fg = colors.comment, bg = colors.background }, 84 | } 85 | ``` 86 | 87 | ### Minimal Configuration 88 | 89 | ```lua 90 | require("prism"):setup({ 91 | reset = true, -- applies the currentTheme everytime neovim is opened 92 | currentTheme = "onedarker", 93 | reload = { "lualine" }, -- modules to be reloaded everytime theme is set 94 | }) 95 | ``` 96 | But yes calling the setup function atleast once is important! 97 | 98 | ## Telescope picker 99 | 100 | There is telescope picker included with this config. Shows the default and as well as the user defined colorschemes. Invoke it by 101 | 102 | ``` 103 | :PrismTelescope 104 | ``` 105 | 106 | ## Commands 107 | 108 | For setting theme without the picker - 109 | 110 | ``` 111 | :PrismSet 112 | ``` 113 | 114 | For setting random theme - 115 | 116 | ``` 117 | :PrismRandom 118 | ``` 119 | 120 | ## Utils 121 | 122 | For even more options for coloring, a bunch of methods have been provided in `prism.utils`. 123 | 124 | - `M.darken(hex, bg, amount)` 125 | - `M.lighten(hex, fg, amount)` 126 | - `M.mix(hex1, hex2, weight)` 127 | - `M.saturate(hex1, factor)` 128 | - `M.moreRed(hex1, factor)` 129 | - `M.moreGreen(hex1, factor)` 130 | - `M.moreBlue(hex1, factor)` 131 | - `M.warm(hex1, factor)` 132 | - `M.cold(hex1, factor)` 133 | 134 | ## Supported Plugins 135 | 136 | - [lualine](https://github.com/nvim-lualine/lualine.nvim) 137 | - [bufferline](https://github.com/akinsho/bufferline.nvim) 138 | - [barbecue](https://github.com/utilyre/barbecue.nvim) 139 | - [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) 140 | - [nvim-tree](https://github.com/kyazdani42/nvim-tree.lua) 141 | - [telescope](https://github.com/nvim-telescope/telescope.nvim) 142 | - [treesitter](https://github.com/nvim-treesitter/nvim-treesitter) 143 | - [whichkey](https://github.com/folke/which-key.nvim) 144 | - [devicons](https://github.com/rcarriga/nvim-notify) 145 | - [harpoon](https://github.com/ThePrimeagen/harpoon) 146 | - [hop](https://github.com/phaazon/hop.nvim) 147 | - [notify](https://github.com/rcarriga/nvim-notify) 148 | 149 | ## Preinstalled themes 150 | 151 | + Biscuit 152 | + Camellia Hope 153 | + Cat 154 | + Decay 155 | + Everblush 156 | + Everforest 157 | + Ghost 158 | + Gruv 159 | + Nord 160 | + Onedarker 161 | + Oxo 162 | + Radium 163 | + Rose 164 | + Tokyodull 165 | 166 | ### Todo 167 | 168 | - [x] Custom highlights 169 | - [x] Transparency 170 | - [x] Some default themes 171 | - [x] More color related functions 172 | - [x] Telescope Prompt 173 | -------------------------------------------------------------------------------- /.github/prism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/namishh/prism/b3a27aa45ce7af0d0f1ddf88b78bf06eca4f13cd/.github/prism.png -------------------------------------------------------------------------------- /.github/vid.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/namishh/prism/b3a27aa45ce7af0d0f1ddf88b78bf06eca4f13cd/.github/vid.mp4 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 chadcat7 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE 10 | -------------------------------------------------------------------------------- /lua/barbecue/theme/prism.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | return { 3 | normal = { fg = colors.foreground, bg = colors.background }, 4 | 5 | ellipsis = { fg = colors.cursorline }, 6 | separator = { fg = colors.cursorline }, 7 | modified = { fg = colors.cursorline }, 8 | 9 | dirname = { fg = colors.foreground }, 10 | basename = { fg = colors.foreground }, 11 | context = { fg = colors.color15 }, 12 | 13 | context_file = { fg = colors.color12 }, 14 | context_module = { fg = colors.color12 }, 15 | context_namespace = { fg = colors.color12 }, 16 | context_package = { fg = colors.color12 }, 17 | context_class = { fg = colors.color3 }, 18 | context_method = { fg = colors.color12 }, 19 | context_property = { fg = colors.color2 }, 20 | context_field = { fg = colors.color2 }, 21 | context_constructor = { fg = colors.color12 }, 22 | context_enum = { fg = colors.color2 }, 23 | context_interface = { fg = colors.color3 }, 24 | context_function = { fg = colors.color12 }, 25 | context_variable = { fg = colors.color5 }, 26 | context_constant = { fg = colors.color9 }, 27 | context_string = { fg = colors.color2 }, 28 | context_number = { fg = colors.color9 }, 29 | context_boolean = { fg = colors.color9 }, 30 | context_array = { fg = colors.color12 }, 31 | context_object = { fg = colors.color12 }, 32 | context_key = { fg = colors.color5 }, 33 | context_null = { fg = colors.color9 }, 34 | context_enum_member = { fg = colors.color1 }, 35 | context_struct = { fg = colors.color12 }, 36 | context_event = { fg = colors.color12 }, 37 | context_operator = { fg = colors.color12 }, 38 | context_type_parameter = { fg = colors.color12 }, 39 | } 40 | -------------------------------------------------------------------------------- /lua/lualine/themes/prism.lua: -------------------------------------------------------------------------------- 1 | local p = require("prism.themer"):getColors() 2 | 3 | return { 4 | normal = { 5 | a = { bg = p.color2, fg = p.background }, 6 | b = { bg = p.background, fg = p.color7 }, 7 | c = { bg = p.background, fg = p.foreground }, 8 | }, 9 | insert = { 10 | a = { bg = p.color10, fg = p.background }, 11 | b = { bg = p.background, fg = p.color4 }, 12 | }, 13 | command = { 14 | a = { bg = p.color1, fg = p.background }, 15 | b = { bg = p.background, fg = p.color5 }, 16 | }, 17 | visual = { 18 | a = { bg = p.color6, fg = p.background }, 19 | b = { bg = p.background, fg = p.color6 }, 20 | }, 21 | replace = { 22 | a = { bg = p.color1, fg = p.background }, 23 | b = { bg = p.background, fg = p.color11 }, 24 | }, 25 | inactive = { 26 | a = { bg = p.background, fg = p.color7 }, 27 | b = { bg = p.background, fg = p.foreground, gui = 'bold' }, 28 | c = { bg = p.background, fg = p.foreground }, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /lua/prism/highlights/bufferline.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | local utils = require("prism.utils") 3 | 4 | return { 5 | 6 | BufferLineBackground = { 7 | fg = colors.comment, 8 | bg = colors.cursorline, 9 | }, 10 | 11 | BufferlineIndicatorVisible = { 12 | fg = colors.cursorline, 13 | bg = colors.cursorline, 14 | }, 15 | 16 | BufferLineBufferSelected = { 17 | fg = colors.foreground, 18 | bg = colors.black, 19 | }, 20 | 21 | BufferLineBufferVisible = { 22 | fg = colors.foreground, 23 | bg = colors.background, 24 | }, 25 | 26 | BufferLineError = { 27 | fg = colors.color9, 28 | bg = colors.cursorline, 29 | }, 30 | BufferLineErrorDiagnostic = { 31 | fg = colors.color4, 32 | bg = colors.cursorline, 33 | }, 34 | 35 | BufferLineCloseButton = { 36 | fg = colors.background, 37 | bg = colors.cursorline, 38 | }, 39 | BufferLineCloseButtonVisible = { 40 | fg = colors.color9, 41 | bg = colors.cursorline, 42 | }, 43 | BufferLineCloseButtonSelected = { 44 | fg = colors.color9, 45 | bg = colors.black, 46 | }, 47 | BufferLineFill = { 48 | fg = colors.cursorline, 49 | bg = colors.cursorline, 50 | }, 51 | BufferlineIndicatorSelected = { 52 | fg = colors.black, 53 | bg = colors.black, 54 | }, 55 | 56 | BufferLineModified = { 57 | fg = colors.color2, 58 | bg = colors.cursorline, 59 | }, 60 | BufferLineModifiedVisible = { 61 | fg = colors.color9, 62 | bg = colors.cursorline, 63 | }, 64 | BufferLineModifiedSelected = { 65 | fg = colors.color2, 66 | bg = colors.black, 67 | }, 68 | 69 | BufferLineSeparator = { 70 | fg = colors.cursorline, 71 | bg = colors.cursorline, 72 | }, 73 | BufferLineSeparatorVisible = { 74 | fg = colors.cursorline, 75 | bg = colors.cursorline, 76 | }, 77 | BufferLineSeparatorSelected = { 78 | fg = colors.cursorline, 79 | bg = colors.cursorline, 80 | }, 81 | 82 | BufferLineTabSelected = { 83 | fg = colors.black, 84 | bg = colors.color4, 85 | }, 86 | BufferLineTabClose = { 87 | fg = colors.color9, 88 | bg = colors.black, 89 | }, 90 | 91 | BufferLineDevIconDefaultSelected = { 92 | bg = "none", 93 | }, 94 | 95 | BufferLineDevIconDefaultInactive = { 96 | bg = "none", 97 | }, 98 | 99 | BufferLineDuplicate = { 100 | fg = "NONE", 101 | bg = colors.cursorline, 102 | }, 103 | BufferLineDuplicateSelected = { 104 | fg = colors.color9, 105 | bg = colors.black, 106 | }, 107 | BufferLineDuplicateVisible = { 108 | fg = colors.color12, 109 | bg = colors.cursorline, 110 | }, 111 | 112 | } 113 | -------------------------------------------------------------------------------- /lua/prism/highlights/cmp.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | local utils = require("prism.utils") 3 | 4 | return { 5 | CmpItemKindClass = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 6 | CmpItemKindEnum = { bg = utils.darken(colors.color5, colors.darker, 0.1), fg = colors.color5 }, 7 | CmpItemKindEnumMember = { bg = utils.darken(colors.color5, colors.darker, 0.1), fg = colors.color5 }, 8 | CmpItemKindSnippet = { bg = utils.darken(colors.color10, colors.darker, 0.1), fg = colors.color10 }, 9 | CmpItemKindField = { bg = utils.darken(colors.color10, colors.darker, 0.1), fg = colors.color10 }, 10 | CmpItemKindText = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 11 | CmpItemKindConstant = { bg = utils.darken(colors.color11, colors.darker, 0.1), fg = colors.color11 }, 12 | CmpItemKindConstructor = { bg = utils.darken(colors.color10, colors.darker, 0.1), fg = colors.color10 }, 13 | CmpItemKindFunction = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 14 | CmpItemKindKeyword = { bg = utils.darken(colors.color5, colors.darker, 0.1), fg = colors.color5 }, 15 | CmpItemKindOperator = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 16 | CmpItemKindProperty = { bg = utils.darken(colors.color5, colors.darker, 0.1), fg = colors.color5 }, 17 | CmpItemKindStruct = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 18 | CmpItemKindTypeParameter = { bg = utils.darken(colors.color2, colors.darker, 0.1), fg = colors.color2 }, 19 | CmpItemKindUnit = { bg = utils.darken(colors.color12, colors.darker, 0.1), fg = colors.color12 }, 20 | CmpItemKindValue = { bg = utils.darken(colors.color10, colors.darker, 0.1), fg = colors.color10 }, 21 | CmpItemKindVariable = { bg = utils.darken(colors.color1, colors.darker, 0.1), fg = colors.color1 }, 22 | CmpItemAbbr = { fg = colors.foreground, }, 23 | CmpItemAbbrDeprecated = { fg = colors.color2, }, 24 | CmpItemAbbrMatch = { fg = colors.color7, }, 25 | CmpItemAbbrMatchFuzzy = { fg = colors.color7, }, 26 | CmpItemKind = { fg = colors.color12, }, 27 | CmpItemMenu = { fg = colors.color12, }, 28 | CmpDoc = { bg = colors.cursorline }, 29 | Pmenu = { fg = colors.foreground, bg = colors.darker }, 30 | PmenuSel = { bg = utils.darken(colors.color4, colors.darker, 0.4) }, 31 | PmenuSbar = { bg = colors.darker }, 32 | PmenuThumb = { bg = colors.color2 }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/prism/highlights/devicons.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | return { 3 | DevIconDefault = { fg = colors.color7 }, 4 | DevIconc = { fg = colors.color12 }, 5 | DevIconASTRO = { fg = colors.color3 }, 6 | DevIconcss = { fg = colors.color12 }, 7 | DevIcondeb = { fg = colors.color6 }, 8 | DevIconDockerfile = { fg = colors.color6 }, 9 | DevIconhtml = { fg = colors.color9 }, 10 | DevIconjpeg = { fg = colors.color2 }, 11 | DevIconjpg = { fg = colors.color2 }, 12 | DevIconjs = { fg = colors.color11 }, 13 | DevIconjsx = { fg = colors.color11 }, 14 | DevIcontsx = { fg = colors.color12 }, 15 | DevIconkt = { fg = colors.color4 }, 16 | DevIconlock = { fg = colors.color4 }, 17 | DevIconmp3 = { fg = colors.color1 }, 18 | DevIconmp4 = { fg = colors.color1 }, 19 | DevIconout = { fg = colors.color1 }, 20 | DevIconpng = { fg = colors.color2 }, 21 | DevIconpy = { fg = colors.color4 }, 22 | DevIcontoml = { fg = colors.color4 }, 23 | DevIconts = { fg = colors.color12 }, 24 | DevIconttf = { fg = colors.color15 }, 25 | DevIconrb = { fg = colors.color9 }, 26 | DevIconrpm = { fg = colors.color11 }, 27 | DevIconvue = { fg = colors.color2 }, 28 | DevIconwoff = { fg = colors.color15 }, 29 | DevIconwoff2 = { fg = colors.color15 }, 30 | DevIconxz = { fg = colors.color11 }, 31 | DevIconzip = { fg = colors.color11 }, 32 | DevIconZig = { fg = colors.color9 }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/prism/highlights/diags.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | local utils = require("prism.utils") 3 | 4 | return { 5 | DiagnosticError = { fg = colors.color9, bg = utils.darken(colors.color9, colors.black, 0.15) }, 6 | DiagnosticWarn = { fg = colors.color11, bg = utils.darken(colors.color11, colors.black, 0.15) }, 7 | DiagnosticHint = { fg = colors.color6, bg = colors.black }, 8 | DiagnosticInfo = { fg = colors.color4, bg = utils.darken(colors.color4, colors.black, 0.15) }, 9 | 10 | } 11 | -------------------------------------------------------------------------------- /lua/prism/highlights/diff.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | return { 3 | diffAdded = { fg = colors.color4 }, 4 | diffRemoved = { fg = colors.color1 }, 5 | diffChanged = { fg = colors.color5 }, 6 | diffOldFile = { fg = colors.color5 }, 7 | diffNewFile = { fg = colors.color5 }, 8 | diffFile = { fg = colors.color7 }, 9 | diffLine = { fg = colors.color1 }, 10 | diffIndexLine = { fg = colors.color12 }, 11 | } 12 | -------------------------------------------------------------------------------- /lua/prism/highlights/git.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | GitSignsAdd = { fg = colors.color4 }, -- diff mode: Added line |diff.txt| 5 | GitSignsChange = { fg = colors.color5 }, -- diff mode: Changed line |diff.txt| 6 | GitSignsDelete = { fg = colors.color1 }, -- diff mode: Deleted line |diff.txt| 7 | } 8 | -------------------------------------------------------------------------------- /lua/prism/highlights/harpoon.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | local utils = require("prism.utils") 3 | 4 | return { 5 | HarpoonWindow = { fg = colors.black, bg = colors.color12 }, 6 | HarpoonBorder = { fg = colors.color4 }, 7 | } 8 | -------------------------------------------------------------------------------- /lua/prism/highlights/hop.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | local utils = require("prism.utils") 3 | 4 | return { 5 | HopNextKey = { fg = colors.color9, bold = true }, 6 | HopNextKey1 = { fg = colors.color2, bold = true }, 7 | HopNextKey2 = { fg = colors.color12, bold = true }, 8 | } 9 | -------------------------------------------------------------------------------- /lua/prism/highlights/indentlines.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | IblIndent = { fg = colors.color0 }, 5 | ["@ibl.indent.char.1"] = { fg = colors.color0 }, 6 | } 7 | -------------------------------------------------------------------------------- /lua/prism/highlights/normal.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | Normal = { fg = colors.foreground, bg = colors.background }, 5 | WinSeparator = { fg = colors.darker, bg = colors.darker }, 6 | MsgSeparator = { fg = colors.darker, bg = colors.darker }, 7 | NoneBG = { fg = colors.foreground, bg = "NONE" }, 8 | SignColumn = { bg = colors.background, fg = colors.background }, 9 | MsgArea = { fg = colors.foreground, bg = colors.background }, 10 | ModeMsg = { fg = colors.foreground, bg = colors.background }, 11 | SpellBad = { fg = colors.color2 }, 12 | SpellCap = { fg = colors.color12 }, 13 | SpellLocal = { fg = colors.color12 }, 14 | SpellRare = { fg = colors.color4 }, 15 | NormalNC = { fg = colors.foreground, bg = colors.background }, 16 | WildMenu = { fg = colors.color7, bg = colors.color4 }, 17 | AbsoluteDark = { bg = colors.darker, fg = colors.foreground }, 18 | AbsoluteCursor = { bg = colors.cursorline, fg = colors.foreground }, 19 | CursorLineNr = { fg = colors.fg }, 20 | Comment = { fg = colors.comment, italic = true }, 21 | Folded = { fg = colors.color4, bg = colors.background }, 22 | FoldColumn = { fg = colors.color12, bg = colors.background }, 23 | LineNr = { fg = colors.color8, bg = colors.background }, 24 | FloatBorder = { fg = colors.foreground, bg = colors.background }, 25 | Whitespace = { fg = colors.color1 }, 26 | VertSplit = { fg = colors.darker, bg = colors.darker }, 27 | CursorLine = { bg = colors.background }, 28 | CursorColumn = { bg = colors.background }, 29 | ColorColumn = { bg = colors.background }, 30 | NormalFloat = { bg = colors.background }, 31 | Visual = { bg = colors.color0, fg = colors.foreground }, 32 | VisualNOS = { bg = colors.background }, 33 | WarningMsg = { fg = colors.color3, bg = colors.background }, 34 | DiffAdd = { bg = colors.background, fg = colors.color12 }, 35 | DiffChange = { bg = colors.background, fg = colors.color5 }, 36 | DiffDelete = { bg = colors.background, fg = colors.color1 }, 37 | QuickFixLine = { bg = colors.color2 }, 38 | MatchParen = { fg = colors.color12, bg = colors.background }, 39 | Cursor = { fg = colors.comment, bg = colors.cursor }, 40 | lCursor = { fg = colors.foreground, bg = colors.cursor }, 41 | CursorIM = { fg = colors.foreground, bg = colors.cursor }, 42 | TermCursor = { fg = colors.foreground, bg = colors.cursor }, 43 | TermCursorNC = { fg = colors.foreground, bg = colors.cursor }, 44 | Conceal = { fg = colors.color4, bg = colors.background }, 45 | Directory = { fg = colors.color12 }, 46 | SpecialKey = { fg = colors.color12 }, 47 | Title = { fg = colors.color11 }, 48 | ErrorMsg = { fg = colors.color1, bg = colors.background }, 49 | Search = { fg = colors.background, bg = colors.color10 }, 50 | IncSearch = { fg = colors.background, bg = colors.color11 }, 51 | Substitute = { fg = colors.color3, bg = colors.color12 }, 52 | MoreMsg = { fg = colors.color5 }, 53 | Question = { fg = colors.color5 }, 54 | EndOfBuffer = { fg = colors.background }, 55 | NonText = { fg = colors.comment }, 56 | Variable = { fg = colors.color5 }, 57 | String = { fg = colors.color10 }, 58 | Character = { fg = colors.color10 }, 59 | Constant = { fg = colors.color10 }, 60 | Number = { fg = colors.color11 }, 61 | Boolean = { fg = colors.color9 }, 62 | Float = { fg = colors.color11 }, 63 | Identifier = { fg = colors.color9 }, 64 | Function = { fg = colors.color9 }, 65 | Operator = { fg = colors.color6 }, 66 | Type = { fg = colors.color6 }, 67 | StorageClass = { fg = colors.color10 }, 68 | Structure = { fg = colors.color12 }, 69 | Typedef = { fg = colors.color6 }, 70 | Keyword = { fg = colors.color14 }, 71 | Statement = { fg = colors.color13 }, 72 | Conditional = { fg = colors.color6 }, 73 | Repeat = { fg = colors.color5 }, 74 | Label = { fg = colors.color12 }, 75 | Exception = { fg = colors.color7 }, 76 | Include = { fg = colors.color10 }, 77 | PreProc = { fg = colors.color5 }, 78 | Define = { fg = colors.color5 }, 79 | Macro = { fg = colors.color5 }, 80 | PreCondit = { fg = colors.color5 }, 81 | Special = { fg = colors.color9 }, 82 | SpecialChar = { fg = colors.color9 }, 83 | Tag = { fg = colors.color12 }, 84 | Debug = { fg = colors.color13 }, 85 | Delimiter = { fg = colors.color7 }, 86 | SpecialComment = { fg = colors.color8 }, 87 | Ignore = { fg = colors.color7, bg = colors.background }, 88 | Todo = { fg = colors.color1, bg = colors.background }, 89 | Error = { fg = colors.color3, bg = colors.background }, 90 | TabLine = { fg = colors.color2, bg = colors.background }, 91 | TabLineSel = { fg = colors.foreground, bg = colors.background }, 92 | TabLineFill = { fg = colors.foreground, bg = colors.background }, 93 | 94 | ['@lsp.type.comment'] = {}, 95 | ['@lsp.type.enum'] = { link = '@type' }, 96 | ['@lsp.type.keyword'] = { link = '@keyword' }, 97 | ['@lsp.type.interface'] = { link = '@interface' }, 98 | ['@lsp.type.namespace'] = { link = '@namespace' }, 99 | ['@lsp.type.parameter'] = { link = '@parameter' }, 100 | ['@lsp.type.property'] = { link = '@property' }, 101 | ['@lsp.type.variable'] = {}, -- use treesitter styles for regular variables 102 | ['@lsp.typemod.function.defaultLibrary'] = { link = 'Special' }, 103 | ['@lsp.typemod.variable.defaultLibrary'] = { link = '@variable.builtin' }, 104 | 105 | -- LSP Injected Groups 106 | ['@lsp.typemod.operator.injected'] = { link = '@operator' }, 107 | ['@lsp.typemod.string.injected'] = { link = '@string' }, 108 | ['@lsp.typemod.variable.injected'] = { link = '@variable' }, 109 | 110 | -- nvim-treesitter Markdown Headings 111 | ['@text.title.1.markdown'] = { link = 'markdownH1' }, 112 | ['@text.title.1.marker.markdown'] = { link = 'markdownH1Delimiter' }, 113 | ['@text.title.2.markdown'] = { link = 'markdownH2' }, 114 | ['@text.title.2.marker.markdown'] = { link = 'markdownH2Delimiter' }, 115 | ['@text.title.3.markdown'] = { link = 'markdownH3' }, 116 | ['@text.title.3.marker.markdown'] = { link = 'markdownH3Delimiter' }, 117 | ['@text.title.4.markdown'] = { link = 'markdownH4' }, 118 | ['@text.title.4.marker.markdown'] = { link = 'markdownH4Delimiter' }, 119 | ['@text.title.5.markdown'] = { link = 'markdownH5' }, 120 | ['@text.title.5.marker.markdown'] = { link = 'markdownH5Delimiter' }, 121 | ['@text.title.6.markdown'] = { link = 'markdownH6' }, 122 | ['@text.title.6.marker.markdown'] = { link = 'markdownH6Delimiter' }, 123 | ['@boolean'] = { link = 'Boolean' }, 124 | ['@character'] = { link = 'Character' }, 125 | ['@character.special'] = { link = '@character' }, 126 | ['@class'] = { fg = colors.color12 }, 127 | ['@comment'] = { link = 'Comment' }, 128 | ['@conditional'] = { link = 'Conditional' }, 129 | ['@constant'] = { link = 'Constant' }, 130 | ['@constant.builtin'] = { fg = colors.color5 }, 131 | ['@constant.macro'] = { link = '@constant' }, 132 | ['@constructor'] = { fg = colors.color12 }, 133 | ['@field'] = { fg = colors.color12 }, 134 | ['@function'] = { link = 'Function' }, 135 | ['@function.builtin'] = { fg = colors.color5 }, 136 | ['@function.macro'] = { link = '@function' }, 137 | ['@include'] = { link = 'Include' }, 138 | ['@interface'] = { fg = colors.color12 }, 139 | ['@keyword'] = { link = 'Keyword' }, 140 | ['@keyword.operator'] = { fg = colors.color7 }, 141 | ['@label'] = { link = 'Label' }, 142 | ['@macro'] = { link = 'Macro' }, 143 | ['@method'] = { fg = colors.color9 }, 144 | ['@number'] = { link = 'Number' }, 145 | ['@operator'] = { link = 'Operator' }, 146 | ['@parameter'] = { fg = colors.color5, }, 147 | ['@preproc'] = { link = 'PreProc' }, 148 | ['@property'] = { fg = colors.color12, }, 149 | ['@punctuation.bracket'] = { link = '@punctuation' }, 150 | ['@punctuation.delimiter'] = { link = '@punctuation' }, 151 | ['@punctuation.special'] = { link = '@punctuation' }, 152 | ['@regexp'] = { link = 'String' }, 153 | ['@repeat'] = { link = 'Repeat' }, 154 | ['@storageclass'] = { link = 'StorageClass' }, 155 | ['@string'] = { link = 'String' }, 156 | ['@string.escape'] = { fg = colors.color6 }, 157 | ['@string.special'] = { link = '@string' }, 158 | ['@symbol'] = { link = 'Identifier' }, 159 | ['@tag'] = { link = 'Tag' }, 160 | ['@tag.attribute'] = { fg = colors.color5 }, 161 | ['@tag.delimiter'] = { fg = colors.color7 }, 162 | ['@text'] = { fg = colors.foreground }, 163 | ['@text.strong'] = { bold = true }, 164 | ['@text.emphasis'] = { italic = true }, 165 | ['@text.underline'] = { underline = true }, 166 | ['@text.strike'] = { strikethrough = true }, 167 | ['@text.math'] = { link = 'Special' }, 168 | ['@text.environment'] = { link = 'Macro' }, 169 | ['@text.environment.name'] = { link = 'Type' }, 170 | ['@text.title'] = { link = 'Title' }, 171 | ['@text.note'] = { link = 'SpecialComment' }, 172 | ['@text.warning'] = { fg = colors.color3 }, 173 | ['@text.danger'] = { fg = colors.color9 }, 174 | ['@todo'] = { link = 'Todo' }, 175 | ['@type'] = { link = 'Type' }, 176 | ['@variable'] = { fg = colors.foreground }, 177 | ['@variable.builtin'] = { fg = colors.color5 }, 178 | ['@namespace'] = { link = '@include' }, 179 | ToggleTerm1Normal = { fg = colors.foreground, bg = colors.background }, 180 | ToggleTerm1WinBar = { fg = colors.foreground, bg = colors.background }, 181 | } 182 | -------------------------------------------------------------------------------- /lua/prism/highlights/notify.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | NotifyERRORBorder = { fg = colors.red }, 5 | NotifyERRORIcon = { fg = colors.red }, 6 | NotifyERRORTitle = { fg = colors.red, italic = true }, 7 | NotifyWARNBorder = { fg = colors.yellow }, 8 | NotifyWARNIcon = { fg = colors.yellow }, 9 | NotifyWARNTitle = { fg = colors.yellow, italic = true }, 10 | NotifyINFOBorder = { fg = colors.color4 }, 11 | NotifyINFOIcon = { fg = colors.color4 }, 12 | NotifyINFOTitle = { fg = colors.color4, italic = true }, 13 | NotifyDEBUGBorder = { fg = colors.color9 }, 14 | NotifyDEBUGIcon = { fg = colors.color9 }, 15 | NotifyDEBUGTitle = { fg = colors.color9, italic = true }, 16 | NotifyTRACEBorder = { fg = colors.foreground }, 17 | NotifyTRACEIcon = { fg = colors.foreground }, 18 | NotifyTRACETitle = { fg = colors.foreground, italic = true }, 19 | } 20 | -------------------------------------------------------------------------------- /lua/prism/highlights/nvimtree.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | return { 3 | NvimTreeNormal = { fg = colors.foreground, bg = colors.darker }, 4 | NvimTreeNormalNC = { fg = colors.foreground, bg = colors.darker }, 5 | NvimTreeRootFolder = { fg = colors.color1 }, 6 | NvimTreeGitDirty = { fg = colors.color1 }, 7 | NvimTreeGitNew = { fg = colors.color12 }, 8 | NvimTreeGitDeleted = { fg = colors.color1 }, 9 | NvimTreeSpecialFile = { fg = colors.color12 }, 10 | NvimTreeIndentMarker = { fg = colors.color0 }, 11 | NvimTreeImageFile = { fg = colors.foreground }, 12 | NvimTreeSymlink = { fg = colors.color12 }, 13 | NvimTreeFolderIcon = { fg = colors.color11, bg = colors.darker }, 14 | NvimTreeFolderName = { fg = colors.foreground }, 15 | NvimTreeOpenedFolderName = { fg = colors.foreground }, 16 | NvimTreeEmptyFolderName = { fg = colors.foreground }, 17 | NvimTreeStatusLineNC = { bg = colors.background, fg = colors.darker }, 18 | } 19 | -------------------------------------------------------------------------------- /lua/prism/highlights/telescope.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | TelescopeBorder = { 5 | fg = colors.darker, 6 | bg = colors.darker, 7 | }, 8 | TelescopePromptBorder = { 9 | fg = colors.cursorline, 10 | bg = colors.cursorline, 11 | }, 12 | TelescopePromptNormal = { 13 | fg = colors.foreground, 14 | bg = colors.cursorline, 15 | }, 16 | TelescopePromptPrefix = { 17 | fg = colors.color1, 18 | bg = colors.cursorline, 19 | }, 20 | TelescopeNormal = { bg = colors.darker }, 21 | TelescopePreviewTitle = { 22 | fg = colors.cursorline, 23 | bg = colors.color12, 24 | }, 25 | TelescopePromptTitle = { 26 | fg = colors.background, 27 | bg = colors.color9, 28 | }, 29 | TelescopeResultsTitle = { 30 | fg = colors.cursorline, 31 | bg = colors.color10, 32 | }, 33 | TelescopeSelection = { bg = colors.cursorline, fg = colors.foreground }, 34 | TelescopeResultsDiffAdd = { 35 | fg = colors.color10, 36 | }, 37 | TelescopeResultsDiffChange = { 38 | fg = colors.color11, 39 | }, 40 | TelescopeResultsDiffDelete = { 41 | fg = colors.color9, 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /lua/prism/highlights/ts.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | -- treesitter 5 | TSAttribute = { fg = colors.color4 }, 6 | TSBoolean = { fg = colors.color12 }, 7 | TSCharacter = { fg = colors.color4 }, 8 | TSComment = { fg = colors.comment, italic = true }, 9 | TSConditional = { fg = colors.color1 }, 10 | TSConstant = { fg = colors.color12 }, 11 | TSConstBuiltin = { fg = colors.color4 }, 12 | TSConstMacro = { fg = colors.color3 }, 13 | TSConstructor = { fg = colors.color4 }, 14 | TSException = { fg = colors.color8 }, 15 | TSField = { fg = colors.color1 }, 16 | TSFloat = { fg = colors.color8 }, 17 | TSFunction = { fg = colors.color1 }, 18 | TSFuncBuiltin = { fg = colors.color14 }, 19 | TSFuncMacro = { fg = colors.color2 }, 20 | TSInclude = { fg = colors.color9 }, 21 | TSKeyword = { fg = colors.color5 }, 22 | TSKeywordFunction = { fg = colors.color4 }, 23 | TsKeywordOperator = { fg = colors.color12 }, 24 | TSKeywordReturn = { fg = colors.color4 }, 25 | TSLabel = { fg = colors.color4 }, 26 | TSMethod = { fg = colors.color12 }, 27 | TSNamespace = { fg = colors.color9 }, 28 | TSNumber = { fg = colors.color3 }, 29 | TSParameter = { fg = colors.color1 }, 30 | TSParameterReference = { fg = colors.color9 }, 31 | TSProperty = { fg = colors.color1 }, 32 | TSPunctDelimiter = { fg = colors.color7 }, 33 | TSPunctBracket = { fg = colors.color7 }, 34 | TSPunctSpecial = { fg = colors.color7 }, 35 | TSRepeat = { fg = colors.color11 }, 36 | TSString = { fg = colors.color2 }, 37 | TSStringRegex = { fg = colors.color2 }, 38 | TSStringEscape = { fg = colors.color4 }, 39 | TSStringSpecial = { fg = colors.color4 }, 40 | TSSymbol = { fg = colors.color1 }, 41 | TSTag = { fg = colors.color4 }, 42 | TSTagAttribute = { fg = colors.color1 }, 43 | TSTagDelimiter = { fg = colors.color7 }, 44 | TSText = { fg = colors.color7 }, 45 | TSStrong = { fg = colors.color7 }, 46 | TSEmphasis = { italic = true, fg = colors.color7 }, 47 | TSUnderline = { fg = colors.color5 }, 48 | TSStrike = { fg = colors.color7 }, 49 | TSTitle = { fg = colors.color3 }, 50 | TSLiteral = { fg = colors.color2 }, 51 | TSURI = { fg = colors.color3 }, 52 | TSMath = { fg = colors.color12 }, 53 | TSTextReference = { fg = colors.color12 }, 54 | TSEnvirontment = { fg = colors.color5 }, 55 | TSEnvironmentName = { fg = colors.color3 }, 56 | TSNote = { fg = colors.color8 }, 57 | TSWarning = { fg = colors.color0, bg = colors.color1 }, 58 | TSDanger = { fg = colors.color8 }, 59 | TSType = { fg = colors.color3 }, 60 | TSTypeBuiltin = { fg = colors.color3 }, 61 | TSVariable = { fg = colors.color7 }, 62 | TSVariableBuiltin = { fg = colors.color4 }, 63 | } 64 | -------------------------------------------------------------------------------- /lua/prism/highlights/whichkey.lua: -------------------------------------------------------------------------------- 1 | local colors = require("prism.themer"):getColors() 2 | 3 | return { 4 | WhichKey = { fg = colors.color4 }, 5 | WhichKeySeparator = { fg = colors.color8 }, 6 | WhichKeyDesc = { fg = colors.color1 }, 7 | WhichKeyGroup = { fg = colors.color3 }, 8 | WhichKeyValue = { fg = colors.color5 }, 9 | WhichKeyFloat = { bg = colors.darker }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/prism/init.lua: -------------------------------------------------------------------------------- 1 | local themer = require("prism.themer") 2 | 3 | local M = {} 4 | 5 | function M:setup(opts) 6 | themer:setup(opts) 7 | end 8 | 9 | return M 10 | -------------------------------------------------------------------------------- /lua/prism/picker.lua: -------------------------------------------------------------------------------- 1 | local pickers = require "telescope.pickers" 2 | local finders = require "telescope.finders" 3 | local actions = require "telescope.actions" 4 | local action_state = require "telescope.actions.state" 5 | local conf = require("telescope.config").values 6 | local themes = require("prism.themer") 7 | local action_set = require "telescope.actions.set" 8 | local entry_display = require("telescope.pickers.entry_display") 9 | local M = {} 10 | 11 | local schemes = {} 12 | for _, file in ipairs(themes.themes) do 13 | table.insert(schemes, file.name) 14 | end 15 | 16 | table.sort(schemes) 17 | 18 | local themeChosen = false 19 | 20 | M.open = function(opts) 21 | opts = opts or {} 22 | pickers.new(opts, { 23 | prompt_title = "Change The Spectrum", 24 | finder = finders.new_table { 25 | results = schemes, 26 | entry_maker = function(entry) 27 | local displayer = entry_display.create({ 28 | separator = opts.separator, 29 | items = { 30 | { width = 0.9 }, 31 | { remaining = true }, 32 | }, 33 | }) 34 | return { 35 | value = entry, 36 | display = function() 37 | return displayer({ 38 | { entry, "NoneBG" }, 39 | }) 40 | end, 41 | ordinal = entry, 42 | } 43 | end 44 | 45 | }, 46 | sorter = conf.generic_sorter(opts), 47 | attach_mappings = function(buffer) 48 | actions.select_default:replace(function() 49 | local theme = action_state.get_selected_entry().value 50 | themes:set(theme) 51 | themeChosen = true 52 | actions.close(buffer) 53 | end) 54 | actions.move_selection_next:replace(function(prompt_bufnr) 55 | action_set.shift_selection(prompt_bufnr, 1) 56 | local theme = action_state.get_selected_entry().value 57 | themes:setTemp(theme) 58 | end) 59 | actions.move_selection_previous:replace(function(prompt_bufnr) 60 | action_set.shift_selection(prompt_bufnr, -1) 61 | local theme = action_state.get_selected_entry().value 62 | themes:setTemp(theme) 63 | end) 64 | return true 65 | end, 66 | }):find() 67 | end 68 | 69 | return M 70 | -------------------------------------------------------------------------------- /lua/prism/schemes/biscuit.lua: -------------------------------------------------------------------------------- 1 | -- thanks to tsukki (https://github.com/tsukki9696) for this colorscheme 2 | return { 3 | name = "biscuit", 4 | color0 = '#231c1c', 5 | color1 = '#CA3F3F', 6 | color2 = '#989F56', 7 | color3 = '#E46A3A', 8 | color4 = '#4A5A8D', 9 | color5 = '#9F569A', 10 | color6 = '#629386', 11 | color7 = '#E5D8CB', 12 | color8 = '#2d2424', 13 | color9 = '#CA3F3F', 14 | color10 = '#989F56', 15 | color11 = '#E46A3A', 16 | color12 = '#4A5A8D', 17 | color13 = '#9F569A', 18 | color14 = '#629386', 19 | color15 = '#F4E6D2', 20 | comment = '#6D5F5F', 21 | background = "#1a1515", 22 | black = '#1a1515', 23 | darker = "#161212", 24 | foreground = '#ffe9c7', 25 | cursorline = '#1f1919', 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/camelliahope.lua: -------------------------------------------------------------------------------- 1 | -- cameilla hope by Vixima https://github.com/Vixima 2 | return { 3 | name = "camelliahope", 4 | background = "#17181C", 5 | foreground = "#e4e5e7", 6 | cursorline = '#1E1F24', 7 | comment = '#8f9093', 8 | darker = '#101013', 9 | cursor = "#e4e5e7", 10 | black = "#17181C", 11 | color0 = "#26272B", 12 | color1 = "#FA3867", 13 | color2 = "#65DB3D", 14 | color3 = "#F57F3D", 15 | color4 = "#4CB2E5", 16 | color5 = "#A771EF", 17 | color6 = "#53DFCA", 18 | color7 = "#CBCCCE", 19 | color8 = "#333438", 20 | color9 = "#FA3867", 21 | color10 = "#65DB3D", 22 | color11 = "#F57F3D", 23 | color12 = "#4CB2E5", 24 | color13 = "#A771EF", 25 | color14 = "#53DFCA", 26 | color15 = "#B0B1B4", 27 | } 28 | -------------------------------------------------------------------------------- /lua/prism/schemes/cat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "cat", 3 | comment = "#6c7086", 4 | background = "#11111b", 5 | black = "#11111b", 6 | darker = "#0d0d15", 7 | foreground = "#f5e0dc", 8 | cursorline = "#161623", 9 | cursor = "#b5bfe2", 10 | color0 = "#292c35", 11 | color1 = "#d05759", 12 | color2 = "#5fbf70", 13 | color3 = "#e0875f", 14 | color4 = "#6481d0", 15 | color5 = "#c669cc", 16 | color6 = "#61aca2", 17 | color7 = "#b5bfe2", 18 | color8 = "#373941", 19 | color9 = "#e56e70", 20 | color10 = "#7fd98f", 21 | color11 = "#efa17f", 22 | color12 = "#7c98e4", 23 | color13 = "#d476da", 24 | color14 = "#70b6ac", 25 | color15 = "#83889a", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/decay.lua: -------------------------------------------------------------------------------- 1 | -- decay from https://github.com/decaycs/decay.nvim 2 | return { 3 | name = "decay", 4 | color0 = '#21262e', 5 | color1 = '#cd5667', 6 | color2 = '#66cd99', 7 | color3 = '#d78e6c', 8 | color4 = '#7297d9', 9 | color5 = '#b47fd7', 10 | color6 = '#8bbce6', 11 | color7 = '#BFBFBF', 12 | color8 = '#242931', 13 | color9 = '#e26c7c', 14 | color10 = '#78DBA9', 15 | color11 = '#e9a180', 16 | color12 = '#86aaec', 17 | color13 = '#c68aee', 18 | color14 = '#9cd1ff', 19 | color15 = '#C1C4CB', 20 | comment = '#485263', 21 | background = "#13161a", 22 | black = '#13161a', 23 | darker = "#0e1114", 24 | foreground = '#dee1e6', 25 | cursor = '#dee1e6', 26 | cursorline = '#14171b', 27 | } 28 | -------------------------------------------------------------------------------- /lua/prism/schemes/dracula.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "dracula", 3 | color0 = '#272935', 4 | color1 = '#ed5858', 5 | color2 = '#50ea77', 6 | color3 = '#f8a36d', 7 | color4 = '#ad80ed', 8 | color5 = '#ed70b8', 9 | color6 = '#7dd0e1', 10 | color7 = '#BFBFBF', 11 | color8 = '#2b2d3a', 12 | color9 = '#f46161', 13 | color10 = '#5af381', 14 | color11 = '#fcaa76', 15 | color12 = '#b58af2', 16 | color13 = '#e070b1', 17 | color14 = '#7ad5e9', 18 | color15 = '#BFBFBF', 19 | comment = '#404749', 20 | background = "#181920", 21 | black = '#181920', 22 | darker = "#14151a", 23 | foreground = '#F8F8F2', 24 | cursorline = '#191b22', 25 | } 26 | -------------------------------------------------------------------------------- /lua/prism/schemes/everblush.lua: -------------------------------------------------------------------------------- 1 | -- theme by mangeshrex https://github.com/Everblush 2 | -- modified by me 3 | return { 4 | name = "everblush", 5 | color0 = '#232a2d', 6 | color1 = '#e65b5b', 7 | color2 = '#6eae5d', 8 | color3 = '#d17849', 9 | color4 = '#5a85db', 10 | color5 = '#ab66dc', 11 | color6 = '#62acac', 12 | color7 = '#b3b9b8', 13 | color8 = '#2d3437', 14 | color9 = '#e86b6b', 15 | color10 = '#6faf7f', 16 | color11 = '#e59063', 17 | color12 = '#76a4e3', 18 | color13 = '#ce89df', 19 | color14 = '#62a5b8', 20 | color15 = '#bdc3c2', 21 | comment = '#404749', 22 | background = "#101618", 23 | black = '#101618', 24 | darker = "#0c1012", 25 | foreground = '#dadada', 26 | cursorline = '#1c2121', 27 | } 28 | -------------------------------------------------------------------------------- /lua/prism/schemes/everforest.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "everforest", 3 | comment = "#5a5858", 4 | background = "#1b2124", 5 | darker = "#151a1c", 6 | black = "#1b2124", 7 | foreground = "#dad0bc", 8 | cursorline = "#22292d", 9 | cursor = "#d3c6aa", 10 | color0 = "#2e383d", 11 | color1 = "#ce6568", 12 | color2 = "#8dc080", 13 | color3 = "#d29571", 14 | color4 = "#85b7b0", 15 | color5 = "#d699b6", 16 | color6 = "#90bd9b", 17 | color7 = "#d3c6aa", 18 | color8 = "#313b41", 19 | color9 = "#e76365", 20 | color10 = "#7cc277", 21 | color11 = "#d69571", 22 | color12 = "#7fbbb3", 23 | color13 = "#d491b1", 24 | color14 = "#7ab98a", 25 | color15 = "#d4d5d5", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/ghost.lua: -------------------------------------------------------------------------------- 1 | -- the ghost scheme from the ghost man himself, javacafe01 https://github.com/JavaCafe01 2 | return { 3 | name = "ghost", 4 | background = "#14171b", 5 | foreground = "#dee1e6", 6 | cursorline = "#181c21", 7 | comment = "#767b82", 8 | darker = "#0f1215", 9 | cursor = "#dee1e6", 10 | black = "#14171b", 11 | color0 = "#1c2128", 12 | color1 = "#f3818b", 13 | color2 = "#77d18b", 14 | color3 = "#ecb083", 15 | color4 = "#97ade5", 16 | color5 = "#b99ada", 17 | color6 = "#68c495", 18 | color7 = "#ced1d6", 19 | color8 = "#242a32", 20 | color9 = "#ee7a84", 21 | color10 = "#68cd7f", 22 | color11 = "#eeaa77", 23 | color12 = "#8fa7e6", 24 | color13 = "#b994df", 25 | color14 = "#5dbb8b", 26 | color15 = "#c0c3c7", 27 | } 28 | -------------------------------------------------------------------------------- /lua/prism/schemes/gruv.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "gruv", 3 | comment = "#928374", 4 | background = "#222222", 5 | darker = "#181818", 6 | black = "#222222", 7 | foreground = "#fbf1c7", 8 | cursorline = "#282828", 9 | cursor = "#fbf1c7", 10 | color0 = "#3c3836", 11 | color1 = "#ea6962", 12 | color2 = "#a9b665", 13 | color3 = "#e79a4e", 14 | color4 = "#7daea3", 15 | color5 = "#d3869b", 16 | color6 = "#89b482", 17 | color7 = "#d4be98", 18 | color8 = "#3c3836", 19 | color9 = "#ea6962", 20 | color10 = "#a9b665", 21 | color11 = "#e79a4e", 22 | color12 = "#7daea3", 23 | color13 = "#d3869b", 24 | color14 = "#89b482", 25 | color15 = "#d4be98", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/nord.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "nord", 3 | background = "#1c2129", 4 | foreground = "#d8dee9", 5 | cursorline = '#232933', 6 | comment = '#79818f', 7 | darker = '#161920', 8 | cursor = "#d8dee9", 9 | black = "#1c2129", 10 | color0 = "#252b35", 11 | color1 = "#d57780", 12 | color2 = "#89b482", 13 | color3 = "#d2956e", 14 | color4 = "#81a1c1", 15 | color5 = "#c183e3", 16 | color6 = "#81b3c1", 17 | color7 = "#bbc0c9", 18 | color8 = "#282f3b", 19 | color9 = "#d56b75", 20 | color10 = "#77b46d", 21 | color11 = "#d28f65", 22 | color12 = "#6f98c1", 23 | color13 = "#bc76e3", 24 | color14 = "#75b0c1", 25 | color15 = "#cdd3dd", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/onedarker.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "onedarker", 3 | background = "#181b21", 4 | foreground = "#dcdee6", 5 | cursorline = '#1c1f26', 6 | comment = '#79818f', 7 | darker = '#111418', 8 | cursor = "#dcdee6", 9 | black = "#181b21", 10 | color0 = "#272b33", 11 | color1 = "#c75f68", 12 | color2 = "#60ae7f", 13 | color3 = "#cb795f", 14 | color4 = "#7095db", 15 | color5 = "#b475c6", 16 | color6 = "#63b0b9", 17 | color7 = "#abb2bf", 18 | color8 = "#2d3139", 19 | color9 = "#e0626c", 20 | color10 = "#6bbd8c", 21 | color11 = "#d9846a", 22 | color12 = "#7ca0e3", 23 | color13 = "#bf75d4", 24 | color14 = "#6ec0cb", 25 | color15 = "#abb2bf", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/oxo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "oxo", 3 | color0 = '#1d1d1d', 4 | color1 = '#e55794', 5 | color2 = '#4be194', 6 | color3 = '#df8157', 7 | color4 = '#759fe8', 8 | color5 = '#a477ea', 9 | color6 = '#1bbab7', 10 | color7 = '#b3b9b8', 11 | color8 = '#252525', 12 | color9 = '#df5b93', 13 | color10 = '#53cb8d', 14 | color11 = '#d9845e', 15 | color12 = '#618dd9', 16 | color13 = '#a27ae1', 17 | color14 = '#1eb1af', 18 | color15 = '#bdc3c2', 19 | comment = '#404749', 20 | background = "#111111", 21 | black = '#111111', 22 | darker = "#0b0b0b", 23 | foreground = '#dadada', 24 | cursorline = '#181818', 25 | } 26 | -------------------------------------------------------------------------------- /lua/prism/schemes/rose.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "rose", 3 | comment = "#6e6a86", 4 | background = "#191724", 5 | black = "#191724", 6 | darker = "#13111e", 7 | foreground = "#e0def4", 8 | cursorline = "#1f1d2e", 9 | cursor = "#b5bfe2", 10 | color0 = "#26233a", 11 | color1 = "#ea5780", 12 | color2 = "#93e49d", 13 | color3 = "#fdb482", 14 | color4 = "#7cb2bb", 15 | color5 = "#b495db", 16 | color6 = "#92cad4", 17 | color7 = "#b5bfe2", 18 | color8 = "#26233a", 19 | color9 = "#ee6a8f", 20 | color10 = "#9ee6a7", 21 | color11 = "#f0ac7c", 22 | color12 = "#8ac1ca", 23 | color13 = "#c1a0ea", 24 | color14 = "#9ad7e1", 25 | color15 = "#908caa", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/schemes/solarized.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "solarized", 3 | comment = "#657b83", 4 | background = "#021a20", 5 | black = "#021a20", 6 | darker = "#001318", 7 | foreground = "#fdf6e3", 8 | cursorline = "#022028", 9 | cursor = "#fdf6e3", 10 | color0 = "#00252f", 11 | color1 = "#b03a38", 12 | color2 = "#7b9524", 13 | color3 = "#b68229", 14 | color4 = "#387098", 15 | color5 = "#9751aa", 16 | color6 = "#4d9590", 17 | color7 = "#eee8d5", 18 | color8 = "#002d39", 19 | color9 = "#b03a38", 20 | color10 = "#7b9524", 21 | color11 = "#b68229", 22 | color12 = "#387098", 23 | color13 = "#9751aa", 24 | color14 = "#4d9590", 25 | color15 = "#eee8d5", 26 | } 27 | 28 | -------------------------------------------------------------------------------- /lua/prism/schemes/tokyodull.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "tokyodull", 3 | comment = "#565f89", 4 | background = "#171721", 5 | black = "#171721", 6 | darker = "#111219", 7 | foreground = "#c0caf5", 8 | cursorline = "#1a1a25", 9 | cursor = "#c0caf5", 10 | color0 = "#212130", 11 | color1 = "#c74d60", 12 | color2 = "#65d17c", 13 | color3 = "#df966a", 14 | color4 = "#577ea6", 15 | color5 = "#8870b2", 16 | color6 = "#55baa6", 17 | color7 = "#bbc6f3", 18 | color8 = "#2d2d3b", 19 | color9 = "#cc596e", 20 | color10 = "#7cdb90", 21 | color11 = "#e4a078", 22 | color12 = "#759bc3", 23 | color13 = "#af99d7", 24 | color14 = "#7dcfff", 25 | color15 = "#bbc6f3", 26 | } 27 | -------------------------------------------------------------------------------- /lua/prism/themer.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local prismPath = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h") 3 | vim.g.themeCache = vim.fn.stdpath "data" .. "/prism/" 4 | vim.g.themeTempCache = vim.fn.stdpath "data" .. "/prism_temp/" 5 | local hl_files = prismPath .. "/highlights" 6 | local schemefiles = prismPath .. "/schemes" 7 | 8 | M.colors = {} 9 | M.modules = {} 10 | M.themes = {} 11 | M.transparent = false 12 | 13 | local function indexOf(array, value) 14 | for i, v in ipairs(array) do 15 | if v == value then 16 | return i 17 | end 18 | end 19 | return nil 20 | end 21 | 22 | function M:gendef() 23 | for _, file in ipairs(vim.fn.readdir(schemefiles)) do 24 | local filename = vim.fn.fnamemodify(file, ":r") 25 | local a = require("prism.schemes." .. filename) 26 | table.insert(self.themes, a) 27 | end 28 | end 29 | 30 | function M:genCustom() 31 | for _, t in ipairs(self.customSchemes) do 32 | for _, i in ipairs(self.themes) do 33 | if i.name == t.name then 34 | table.remove(self.themes, indexOf(self.themes, i)) 35 | break 36 | end 37 | end 38 | table.insert(self.themes, t) 39 | end 40 | vim.g.prismThemes = self.themes 41 | end 42 | 43 | function M:genThemes() 44 | self.themes = {} 45 | M:gendef() 46 | M:genCustom() 47 | end 48 | 49 | function M:mergeTb(...) 50 | return vim.tbl_deep_extend("force", ...) 51 | end 52 | 53 | function M:loadLocalTb(g) 54 | g = require(M.customFilesPath .. "." .. g) 55 | return g 56 | end 57 | 58 | function M:loadTb(g) 59 | g = require("prism.highlights." .. g) 60 | return g 61 | end 62 | 63 | function M:tableToStr(tb) 64 | local result = "" 65 | 66 | for hlgroupName, hlgroup_vals in pairs(tb) do 67 | local hlname = "'" .. hlgroupName .. "'," 68 | local opts = "" 69 | 70 | for optName, optVal in pairs(hlgroup_vals) do 71 | local valueInStr = ((type(optVal)) == "boolean" or type(optVal) == "number") and tostring(optVal) 72 | or '"' .. optVal .. '"' 73 | opts = opts .. optName .. "=" .. valueInStr .. "," 74 | end 75 | 76 | result = result .. "vim.api.nvim_set_hl(0," .. hlname .. "{" .. opts .. "})" 77 | end 78 | 79 | return result 80 | end 81 | 82 | function M:getColors() 83 | if M.transparent then 84 | self.colors.background = "NONE" 85 | end 86 | return self.colors 87 | end 88 | 89 | function M:toCache(filename, tb, path) 90 | local lines = "return string.dump(function()" .. self:tableToStr(tb) .. "end, true)" 91 | local file = io.open(path .. filename, "wb") 92 | 93 | if file then 94 | ---@diagnostic disable-next-line: deprecated 95 | file:write(loadstring(lines)()) 96 | file:close() 97 | end 98 | end 99 | 100 | function M:compile(path) 101 | if not vim.loop.fs_stat(path) then 102 | vim.fn.mkdir(path, "p") 103 | end 104 | 105 | local allThemes = {} 106 | 107 | for _, file in ipairs(vim.fn.readdir(hl_files)) do 108 | local filename = vim.fn.fnamemodify(file, ":r") 109 | local a = M:loadTb(filename) 110 | for k, f in pairs(a) do 111 | allThemes[k] = f 112 | end 113 | end 114 | if M.customFiles ~= "" then 115 | for _, file in ipairs(vim.fn.readdir(M.customFiles)) do 116 | local filename = vim.fn.fnamemodify(file, ":r") 117 | local a = M:loadLocalTb(filename) 118 | for k, f in pairs(a) do 119 | for _, i in pairs(allThemes) do 120 | if i == f then 121 | table.remove(allThemes, indexOf(allThemes, i)) 122 | break 123 | end 124 | end 125 | allThemes[k] = f 126 | end 127 | end 128 | end 129 | 130 | self:toCache("allThemes", allThemes, path) 131 | end 132 | 133 | function M:setTermCols(colors) 134 | vim.g.terminal_color_0 = colors.color0 135 | vim.g.terminal_color_1 = colors.color1 136 | vim.g.terminal_color_2 = colors.color2 137 | vim.g.terminal_color_3 = colors.color3 138 | vim.g.terminal_color_4 = colors.color4 139 | vim.g.terminal_color_5 = colors.color5 140 | vim.g.terminal_color_6 = colors.color6 141 | vim.g.terminal_color_7 = colors.color7 142 | vim.g.terminal_color_8 = colors.color8 143 | vim.g.terminal_color_9 = colors.color9 144 | vim.g.terminal_color_10 = colors.color10 145 | vim.g.terminal_color_11 = colors.color11 146 | vim.g.terminal_color_12 = colors.color12 147 | vim.g.terminal_color_13 = colors.color13 148 | vim.g.terminal_color_14 = colors.color14 149 | vim.g.terminal_color_15 = colors.color15 150 | end 151 | 152 | function M:load(path) 153 | M:compile(path) 154 | dofile(path .. "allThemes") 155 | end 156 | 157 | function M:loadColsOnly() 158 | dofile(vim.g.themeCache .. "allThemes") 159 | end 160 | 161 | function M:reloadModule(name) 162 | require("plenary.reload").reload_module(name) 163 | end 164 | 165 | function M:reloadAllModules() 166 | for _, mod in ipairs(self.modules) do 167 | self:reloadModule(mod) 168 | end 169 | end 170 | 171 | vim.api.nvim_create_autocmd({ "CursorHold" }, { 172 | callback = function() 173 | M:setCmds() 174 | end 175 | }) 176 | 177 | function M:setup(opts) 178 | opts = opts or {} 179 | self.customSchemes = opts.customSchemes or {} 180 | local currentTheme = opts.currentTheme or "cat" 181 | local reset = false 182 | if opts.reset == true then 183 | reset = true 184 | end 185 | local mods = opts.reload or {} 186 | for _, t in ipairs(mods) do 187 | table.insert(self.modules, t) 188 | end 189 | local curr = {} 190 | M:genThemes() 191 | for _, t in ipairs(self.themes) do 192 | if t.name == currentTheme then 193 | curr = t 194 | break 195 | end 196 | end 197 | self.colors = curr 198 | M.transparent = opts.transparent or M.transparent 199 | M.customFiles = opts.customFiles or "" 200 | local function mysplit(inputstr, sep) 201 | if sep == nil then 202 | sep = "%s" 203 | end 204 | local t = {} 205 | for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do 206 | table.insert(t, str) 207 | end 208 | return t 209 | end 210 | 211 | local a = tostring(M.customFiles):gsub(tostring(vim.fn.stdpath "config" .. "/lua/"), "") 212 | local f = mysplit(a, "/") 213 | local n = table.concat(f, ".") 214 | M.customFilesPath = n or "" 215 | if reset then 216 | M:load(vim.g.themeCache) 217 | else 218 | if vim.fn.isdirectory(vim.g.themeCache) ~= 1 then 219 | M:load(vim.g.themeCache) 220 | else 221 | M:loadColsOnly() 222 | end 223 | end 224 | end 225 | 226 | function M:set(name) 227 | self:reloadModule("prism.highlights") 228 | if M.customFiles ~= "" then 229 | self:reloadModule("" .. self.customFilesPath) 230 | end 231 | self:reloadAllModules() 232 | local theme 233 | for _, i in ipairs(self.themes) do 234 | if i.name == name then 235 | theme = i 236 | break 237 | end 238 | end 239 | self.colors = theme 240 | M:setTermCols(theme) 241 | M:load(vim.g.themeCache) 242 | end 243 | 244 | function M:setTemp(name) 245 | self:reloadModule("prism.highlights") 246 | if M.customFiles ~= "" then 247 | self:reloadModule("" .. self.customFilesPath) 248 | end 249 | self:reloadAllModules() 250 | local theme 251 | for _, i in ipairs(self.themes) do 252 | if i.name == name then 253 | theme = i 254 | break 255 | end 256 | end 257 | self.colors = theme 258 | M:setTermCols(theme) 259 | M:load(vim.g.themeTempCache) 260 | end 261 | 262 | function M:random() 263 | self:genThemes() 264 | local theme = self.themes[math.random(#self.themes)] 265 | self:set(theme.name) 266 | end 267 | 268 | local has_value = function(tab, val) 269 | for _, value in ipairs(tab) do 270 | if value == val then 271 | return true 272 | end 273 | end 274 | return false 275 | end 276 | 277 | function M:openTelescope() 278 | self:genThemes() 279 | require("prism.picker").open(require("telescope.themes").get_dropdown { 280 | layout_config = { 281 | preview_cutoff = 1, -- Preview should always show (unless previewer = false) 282 | width = 69, 283 | height = 18, 284 | }, 285 | } 286 | ) 287 | end 288 | 289 | function M:setCmds() 290 | local available_themes = {} 291 | for _, val in ipairs(M.themes) do 292 | table.insert(available_themes, val.name) 293 | end 294 | table.sort(available_themes) 295 | local cmd = vim.api.nvim_create_user_command 296 | cmd( 297 | 'PrismSet', 298 | function(opts) 299 | if has_value(available_themes, opts.args) then 300 | self:set(opts.args) 301 | else 302 | print 'Invalid Theme' 303 | end 304 | end, 305 | { 306 | nargs = 1, 307 | complete = function() 308 | return available_themes 309 | end, 310 | 311 | } 312 | ) 313 | cmd( 314 | 'PrismRandom', 315 | function() 316 | self:random() 317 | end, 318 | { nargs = 0 } 319 | ) 320 | 321 | cmd( 322 | 'PrismTelescope', 323 | function() 324 | self:openTelescope() 325 | self:setTemp(M.themes[1].name) 326 | end, 327 | { nargs = 0 } 328 | ) 329 | end 330 | 331 | return M 332 | -------------------------------------------------------------------------------- /lua/prism/utils.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local function hexToRgb(c) 4 | c = string.lower(c) 5 | return { tonumber(c:sub(2, 3), 16), tonumber(c:sub(4, 5), 16), tonumber(c:sub(6, 7), 16) } 6 | end 7 | 8 | local function rgbToHsl(r, g, b) 9 | r, g, b = r / 255, g / 255, b / 255 -- Normalize RGB values to the range [0, 1] 10 | local max = math.max(r, g, b) 11 | local min = math.min(r, g, b) 12 | local h, s, l 13 | l = (max + min) / 2 14 | if max == min then 15 | h = 0 16 | s = 0 -- Monochromatic 17 | else 18 | local d = max - min 19 | s = l > 0.5 and d / (2 - max - min) or d / (max + min) 20 | if max == r then 21 | h = (g - b) / d + (g < b and 6 or 0) 22 | elseif max == g then 23 | h = (b - r) / d + 2 24 | else 25 | h = (r - g) / d + 4 26 | end 27 | h = h / 6 28 | end 29 | return h, s, l 30 | end 31 | 32 | local function hslToRgb(h, s, l) 33 | if s == 0 then 34 | return l, l, l -- Achromatic (gray) 35 | end 36 | 37 | h = (h % 1 + 1) % 1 -- Ensure h is in the range [0, 1] 38 | s = math.min(1, math.max(0, s)) -- Clamp s to [0, 1] 39 | l = math.min(1, math.max(0, l)) -- Clamp l to [0, 1] 40 | 41 | local function hueToRgb(p, q, t) 42 | if t < 0 then t = t + 1 end 43 | if t > 1 then t = t - 1 end 44 | if t < 1 / 6 then return p + (q - p) * 6 * t end 45 | if t < 1 / 2 then return q end 46 | if t < 2 / 3 then return p + (q - p) * (2 / 3 - t) * 6 end 47 | return p 48 | end 49 | 50 | local q = l < 0.5 and l * (1 + s) or l + s - l * s 51 | local p = 2 * l - q 52 | local r = hueToRgb(p, q, h + 1 / 3) 53 | local g = hueToRgb(p, q, h) 54 | local b = hueToRgb(p, q, h - 1 / 3) 55 | 56 | return r, g, b 57 | end 58 | 59 | M.blend = function(foreground, background, alpha) 60 | alpha = type(alpha) == "string" and (tonumber(alpha, 16) / 0xff) or alpha 61 | local bg = hexToRgb(background) 62 | local fg = hexToRgb(foreground) 63 | 64 | local blendChannel = function(i) 65 | local ret = (alpha * fg[i] + ((1 - alpha) * bg[i])) 66 | return math.floor(math.min(math.max(0, ret), 255) + 0.5) 67 | end 68 | 69 | return string.format("#%02x%02x%02x", blendChannel(1), blendChannel(2), blendChannel(3)) 70 | end 71 | 72 | M.darken = function(hex, bg, amount) 73 | return M.blend(hex, bg, amount) 74 | end 75 | 76 | M.lighten = function(hex, fg, amount) 77 | return M.blend(hex, fg, amount) 78 | end 79 | 80 | M.mix = function(c1, c2, wt) 81 | local r1 = tonumber(string.sub(c1, 2, 3), 16) 82 | local g1 = tonumber(string.sub(c1, 4, 5), 16) 83 | local b1 = tonumber(string.sub(c1, 6, 7), 16) 84 | 85 | local r2 = tonumber(string.sub(c2, 2, 3), 16) 86 | local g2 = tonumber(string.sub(c2, 4, 5), 16) 87 | local b2 = tonumber(string.sub(c2, 6, 7), 16) 88 | 89 | wt = math.min(1, math.max(0, wt)) 90 | 91 | local nr = math.floor((1 - wt) * r1 + wt * r2) 92 | local ng = math.floor((1 - wt) * g1 + wt * g2) 93 | local nb = math.floor((1 - wt) * b1 + wt * b2) 94 | 95 | return string.format("#%02X%02X%02X", nr, ng, nb) 96 | end 97 | 98 | M.saturate = function(c, factor) 99 | local r = tonumber(string.sub(c, 2, 3), 16) 100 | local g = tonumber(string.sub(c, 4, 5), 16) 101 | local b = tonumber(string.sub(c, 6, 7), 16) 102 | local h, s, l = rgbToHsl(r, g, b) 103 | s = s + factor 104 | 105 | s = math.min(1, math.max(0, s)) 106 | 107 | r, g, b = hslToRgb(h, s, l) 108 | local newHexColor = string.format("#%02X%02X%02X", r * 255, g * 255, b * 255) 109 | 110 | return newHexColor 111 | end 112 | 113 | M.moreRed = function(c, f) 114 | local r = tonumber(string.sub(c, 2, 3), 16) 115 | local g = tonumber(string.sub(c, 4, 5), 16) 116 | local b = tonumber(string.sub(c, 6, 7), 16) 117 | r = r + f 118 | r = math.min(255, math.max(0, r)) 119 | return string.format("#%02X%02X%02X", r, g, b) 120 | end 121 | 122 | 123 | M.moreGreen = function(c, f) 124 | local r = tonumber(string.sub(c, 2, 3), 16) 125 | local g = tonumber(string.sub(c, 4, 5), 16) 126 | local b = tonumber(string.sub(c, 6, 7), 16) 127 | g = g + f 128 | g = math.min(255, math.max(0, g)) 129 | return string.format("#%02X%02X%02X", r, g, b) 130 | end 131 | 132 | 133 | M.moreBlue = function(c, f) 134 | local r = tonumber(string.sub(c, 2, 3), 16) 135 | local g = tonumber(string.sub(c, 4, 5), 16) 136 | local b = tonumber(string.sub(c, 6, 7), 16) 137 | b = b + f 138 | b = math.min(255, math.max(0, b)) 139 | return string.format("#%02X%02X%02X", r, g, b) 140 | end 141 | 142 | M.cold = function(c, f) 143 | return M.moreBlue(c, f) 144 | end 145 | 146 | M.warm = function(c, f) 147 | local r = tonumber(string.sub(c, 2, 3), 16) 148 | local g = tonumber(string.sub(c, 4, 5), 16) 149 | local b = tonumber(string.sub(c, 6, 7), 16) 150 | r = r + f 151 | g = g + f 152 | r = math.min(255, math.max(0, r)) 153 | g = math.min(255, math.max(0, g)) 154 | return string.format("#%02X%02X%02X", r, g, b) 155 | end 156 | 157 | return M 158 | --------------------------------------------------------------------------------