Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AstroNvim/astrotheme
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.6.1
Choose a base ref
...
head repository: AstroNvim/astrotheme
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.7.0
Choose a head ref
  • 5 commits
  • 12 files changed
  • 2 contributors

Commits on Apr 4, 2024

  1. test(lib): add Plenary based unit testing for astrotheme.lib.color (#…

    mehalter authored Apr 4, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c9c8b81 View commit details
  2. chore(build): auto-generate vimdoc

    astronvimbot committed Apr 4, 2024
    Copy the full SHA
    48a4253 View commit details

Commits on Apr 10, 2024

  1. feat(plugins): add nvcheatsheet.nvim support

    mehalter committed Apr 10, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    mehalter Micah Halter
    Copy the full SHA
    df9251f View commit details
  2. chore(build): auto-generate vimdoc

    astronvimbot committed Apr 10, 2024
    Copy the full SHA
    c9f7de8 View commit details
  3. chore(main): release 3.7.0 (#123)

    astronvimbot authored Apr 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8b316aa View commit details
Showing with 265 additions and 183 deletions.
  1. +20 −0 .github/workflows/tests.yml
  2. +1 −1 .neoconf.json
  3. +7 −0 CHANGELOG.md
  4. +11 −0 Makefile
  5. +1 −0 README.md
  6. +3 −1 doc/astrotheme.txt
  7. +1 −0 lua/astrotheme/groups/plugins/init.lua
  8. +21 −0 lua/astrotheme/groups/plugins/nvcheatsheet.lua
  9. +8 −0 neovim.yml
  10. +183 −0 tests/astrotheme_spec.lua
  11. +0 −181 tests/color.lua
  12. +9 −0 tests/minimal_init.lua
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tests
on:
push:
branches: [main]
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
nvim-version: ["stable", "nightly"]
name: Neovim ${{ matrix.nvim-version }}
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim-version }}
- run: make test
2 changes: 1 addition & 1 deletion .neoconf.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"neodev": {
"library": {
"enabled": true,
"plugins": ["lazy.nvim"]
"plugins": ["lazy.nvim", "plenary.nvim"]
}
},
"neoconf": {
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [3.7.0](https://github.com/AstroNvim/astrotheme/compare/v3.6.1...v3.7.0) (2024-04-10)


### Features

* **plugins:** add `nvcheatsheet.nvim` support ([df9251f](https://github.com/AstroNvim/astrotheme/commit/df9251fcf94b77f9f512191c2666c3dbd882777e))

## [3.6.1](https://github.com/AstroNvim/astrotheme/compare/v3.6.0...v3.6.1) (2024-04-01)


11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TESTS_INIT=tests/minimal_init.lua
TESTS_DIR=tests/

.PHONY: test

test:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${TESTS_INIT}' }"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -246,6 +246,7 @@ term.foreground
| [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) | `neo-tree` |
| [neogit](https://github.com/NeogitOrg/neogit) | `neogit` |
| [noice.nvim](https://github.com/folke/noice.nvim) | `noice` |
| [nvcheatsheet.nvim](https://github.com/smartinellimarco/nvcheatsheet.nvim) | `nvcheatsheet` |
| [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) | `nvim-cmp` |
| [nvim-dap-ui](https://github.com/rcarriga/nvim-dap-ui) | `nvim-dap-ui` |
| [nvim-notify](https://github.com/rcarriga/nvim-notify) | `nvim-notify` |
4 changes: 3 additions & 1 deletion doc/astrotheme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*astrotheme.txt* For Neovim >= 0.9.0 Last change: 2024 April 01
*astrotheme.txt* For Neovim >= 0.9.0 Last change: 2024 April 10

==============================================================================
Table of Contents *astrotheme-table-of-contents*
@@ -249,6 +249,8 @@ SUPPORTED PLUGINS *astrotheme-supported-plugins*

noice.nvim noice

nvcheatsheet.nvim nvcheatsheet

nvim-cmp nvim-cmp

nvim-dap-ui nvim-dap-ui
1 change: 1 addition & 0 deletions lua/astrotheme/groups/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ return {
["neo-tree.nvim"] = "neo-tree",
["neogit"] = "neogit",
["noice.nvim"] = "noice",
["nvcheatsheet.nvim"] = "nvcheatsheet",
["nvim-cmp"] = "nvim-cmp",
["nvim-dap-ui"] = "nvim-dap-ui",
["nvim-notify"] = "nvim-notify",
21 changes: 21 additions & 0 deletions lua/astrotheme/groups/plugins/nvcheatsheet.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---@type AstroThemeCallback
local function callback(opts)
return {
NvChAsciiHeader = { bg = opts.transparent and C.none or C.ui.base, fg = C.ui.title }, -- Title
NvChSection = { bg = C.ui.highlight }, -- Each card

-- Colors for the headers
NvCheatsheetWhite = { bg = C.ui.text_match, fg = C.ui.base },
NvCheatsheetGray = { bg = C.ui.text, fg = C.ui.base },
NvCheatsheetBlue = { bg = C.ui.blue, fg = C.ui.base },
NvCheatsheetCyan = { bg = C.ui.cyan, fg = C.ui.base },
NvCheatsheetRed = { bg = C.ui.red, fg = C.ui.base },
NvCheatsheetGreen = { bg = C.ui.green, fg = C.ui.base },
NvCheatsheetYellow = { bg = C.ui.yellow, fg = C.ui.base },
NvCheatsheetOrange = { bg = C.ui.orange, fg = C.ui.base },
NvCheatsheetPurple = { bg = C.ui.purple, fg = C.ui.base },
NvCheatsheetMagenta = { bg = C.syntax.purple, fg = C.ui.base },
}
end

return callback
8 changes: 8 additions & 0 deletions neovim.yml
Original file line number Diff line number Diff line change
@@ -8,3 +8,11 @@ globals:
any: true
packer_plugins:
any: true
describe:
args:
- type: string
- type: function
it:
args:
- type: string
- type: function
183 changes: 183 additions & 0 deletions tests/astrotheme_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
describe("Color Library", function()
local Color = require "astrotheme.lib.color"

local c1 = Color.new { 10, 10, 10 }
local c2 = Color.new { 5, 5, 5 }
local c3 = Color.new { 0, 0, 0 }
local c4 = Color.new { 25, 65, 50 }

it("Constructor with RGB vs Hex", function() assert.equals(Color.new { 10, 10, 10 }, Color.new "#0A0A0A") end)
it("Add Operation", function() assert.equals(c1 + c2, Color.new { 15, 15, 15 }) end)
it("Divide Operation", function() assert.equals((c1 + c2) / 2, Color.new { 7.5, 7.5, 7.5 }) end)
it("Multiply Operation", function() assert.equals(c1 * c2, Color.new { 50, 50, 50 }) end)
it("Subtraction Operation", function() assert.equals(c1 - c2, Color.new { 5, 5, 5 }) end)
it("Equal Operation", function() assert.equals(c1, Color.new { 10, 10, 10 }) end)
it("Less Than Operation", function() assert.True(c2 < c1) end)

it("blend Function", function() assert.equals(c1:blend(c3, 0.5), Color.new { 5, 5, 5 }) end)
it("darken Function", function() assert.equals(c4:darken(30), Color.new { 0, 35, 20 }) end)
it("darken_2 Function", function() assert.equals(c4:darken_2(30), Color.new { 7, 41, 32 }) end)
it("desat Function", function() assert.equals(c4:desat(1), Color.new { 55, 55, 55 }) end)
it("dif Function", function() assert.equals(c2:dif(c3), 5) end)
it("lighten Function", function() assert.equals(c4:lighten(30), Color.new { 55, 95, 80 }) end)
it("lighten_2 Function", function() assert.equals(c4:lighten_2(30), Color.new { 55, 83, 68 }) end)
it("sat Function", function() assert.equals(c4:sat(1), Color.new { 0, 65, 48 }) end)
it("sort Function", function() assert.are.same(c4:sort(), { "r", "b", "g" }) end)
it("tohex Function", function() assert.equals(c1:tohex(), "#0A0A0A") end)

it("Visual Full Spectrum Color Test", function()
local bl = Color.new "#1A1D23"
local w = Color.new "#DEDEDE"
local r = Color.new "#FF838B"
local o = Color.new "#F5983A"
local y = Color.new "#DFAB25"
local g = Color.new "#87C05F"
local c = Color.new "#4AC2B8"
local b = Color.new "#5EB7FF"
local p = Color.new "#DD97F1"

local offset = 30

print "DARK / ORIGINAL / LIGHT - ALT\n"
io.write(tostring(bl:darken_2(offset)))
io.write(tostring(w:darken_2(offset)))
io.write(tostring(r:darken_2(offset)))
io.write(tostring(o:darken_2(offset)))
io.write(tostring(y:darken_2(offset)))
io.write(tostring(g:darken_2(offset)))
io.write(tostring(c:darken_2(offset)))
io.write(tostring(b:darken_2(offset)))
io.write(tostring(p:darken_2(offset)))
io.write "\n"

io.write(tostring(bl))
io.write(tostring(w))
io.write(tostring(r))
io.write(tostring(o))
io.write(tostring(y))
io.write(tostring(g))
io.write(tostring(c))
io.write(tostring(b))
io.write(tostring(p))
io.write "\n"

io.write(tostring(bl:lighten_2(offset)))
io.write(tostring(w:lighten_2(offset)))
io.write(tostring(r:lighten_2(offset)))
io.write(tostring(o:lighten_2(offset)))
io.write(tostring(y:lighten_2(offset)))
io.write(tostring(g:lighten_2(offset)))
io.write(tostring(c:lighten_2(offset)))
io.write(tostring(b:lighten_2(offset)))
io.write(tostring(p:lighten_2(offset)))
io.write "\n"

print "\nDARK / ORIGINAL / LIGHT\n"
io.write(tostring(bl:darken(offset)))
io.write(tostring(w:darken(offset)))
io.write(tostring(r:darken(offset)))
io.write(tostring(o:darken(offset)))
io.write(tostring(y:darken(offset)))
io.write(tostring(g:darken(offset)))
io.write(tostring(c:darken(offset)))
io.write(tostring(b:darken(offset)))
io.write(tostring(p:darken(offset)))
io.write "\n"

io.write(tostring(bl))
io.write(tostring(w))
io.write(tostring(r))
io.write(tostring(o))
io.write(tostring(y))
io.write(tostring(g))
io.write(tostring(c))
io.write(tostring(b))
io.write(tostring(p))
io.write "\n"

io.write(tostring(bl:lighten(offset)))
io.write(tostring(w:lighten(offset)))
io.write(tostring(r:lighten(offset)))
io.write(tostring(o:lighten(offset)))
io.write(tostring(y:lighten(offset)))
io.write(tostring(g:lighten(offset)))
io.write(tostring(c:lighten(offset)))
io.write(tostring(b:lighten(offset)))
io.write(tostring(p:lighten(offset)))
io.write "\n"

print "\nBLEND\n"
io.write(tostring(bl:blend(r, 0.5)))
io.write(tostring(bl:blend(o, 0.5)))
io.write(tostring(bl:blend(y, 0.5)))
io.write(tostring(bl:blend(g, 0.5)))
io.write(tostring(bl:blend(c, 0.5)))
io.write(tostring(bl:blend(b, 0.5)))
io.write(tostring(bl:blend(p, 0.5)))
io.write "\n"
io.write(tostring(w:blend(r, 0.5)))
io.write(tostring(w:blend(o, 0.5)))
io.write(tostring(w:blend(y, 0.5)))
io.write(tostring(w:blend(g, 0.5)))
io.write(tostring(w:blend(c, 0.5)))
io.write(tostring(w:blend(b, 0.5)))
io.write(tostring(w:blend(p, 0.5)))
io.write "\n"

print "\nDESATURATION\n"
io.write(tostring(r:desat(0)))
io.write(tostring(o:desat(0)))
io.write(tostring(y:desat(0)))
io.write(tostring(g:desat(0)))
io.write(tostring(c:desat(0)))
io.write(tostring(b:desat(0)))
io.write(tostring(p:desat(0)))
io.write "\n"

io.write(tostring(r:desat(0.5)))
io.write(tostring(o:desat(0.5)))
io.write(tostring(y:desat(0.5)))
io.write(tostring(g:desat(0.5)))
io.write(tostring(c:desat(0.5)))
io.write(tostring(b:desat(0.5)))
io.write(tostring(p:desat(0.5)))
io.write "\n"

io.write(tostring(r:desat(1)))
io.write(tostring(o:desat(1)))
io.write(tostring(y:desat(1)))
io.write(tostring(g:desat(1)))
io.write(tostring(c:desat(1)))
io.write(tostring(b:desat(1)))
io.write(tostring(p:desat(1)))
io.write "\n"

print "\nSATURATION\n"
io.write(tostring(r:sat(0)))
io.write(tostring(o:sat(0)))
io.write(tostring(y:sat(0)))
io.write(tostring(g:sat(0)))
io.write(tostring(c:sat(0)))
io.write(tostring(b:sat(0)))
io.write(tostring(p:sat(0)))
io.write "\n"

io.write(tostring(r:sat(0.5)))
io.write(tostring(o:sat(0.5)))
io.write(tostring(y:sat(0.5)))
io.write(tostring(g:sat(0.5)))
io.write(tostring(c:sat(0.5)))
io.write(tostring(b:sat(0.5)))
io.write(tostring(p:sat(0.5)))
io.write "\n"

io.write(tostring(r:sat(1)))
io.write(tostring(o:sat(1)))
io.write(tostring(y:sat(1)))
io.write(tostring(g:sat(1)))
io.write(tostring(c:sat(1)))
io.write(tostring(b:sat(1)))
io.write(tostring(p:sat(1)))
io.write "\n"
end)
end)
Loading