Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from ful1e5/dev
Browse files Browse the repository at this point in the history
👔 Kitty tab color changed
  • Loading branch information
ful1e5 authored Jun 16, 2021
2 parents 35b13ca + 98abd0f commit bf020a4
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 146 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linting

on:
push:
branches: [main, dev]
pull_request:
paths-ignore:
- "**.md"
- LICENSE
branches: [main]

jobs:
build:
name: Luacheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install linter
run: |
sudo apt-get update
sudo apt-get install luarocks
sudo luarocks install luacheck
- name: Lint
run: make lint
4 changes: 4 additions & 0 deletions .lua-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
column_limit: 90
indent_width: 2
single_quote_to_double_quote: true
keep_simple_function_one_line: false
3 changes: 3 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
globals = {
"vim",
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

### Added

- `Linting` Github Action init
- `Makefile, .lua-format, .luacheckrc` init
- format .lua code with (lua-format)[https://github.com/Koihik/LuaFormatter]
- `kitty` tabs color changed

### Changed

- **VertSplit** & **Inactive StatusLine** `fg` color changed to `bg_visual`

## [v0.0.1] - 14 June 2021

### Added
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DEFAULT_GOAL = check

onedark_path = lua/onedark
extra_path = $(onedark_path)/extra

extra: $(extra_path)
@lua $(extra_path)/init.lua

format:
@for file in `find . -name '*.lua'`;do lua-format $$file -i; done;

lint: $(onedark_path)
@luacheck $(onedark_path)

check: format lint
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ Extra color configs for **Kitty**, and **Alacritty** can be found in [extras](ex
## 📺 Screenshot

<p align="center">
<img src="https://imgur.com/Vm6wfB3.png" alt="onedark.nvim" />
<img src="https://imgur.com/tptzxgH.png" alt="onedark.nvim" />
</p>

### Default

<p align="center">
<img src="https://imgur.com/8KbGV7r.png" alt="Default fonts" />
</p>

### Normal
Expand All @@ -169,7 +175,7 @@ vim.g.onedark_italic_variables = false
```

<p align="center">
<img src="https://imgur.com/nEVfxVu.png" alt="Normal fonts" />
<img src="https://imgur.com/QZ0R0qC.png" alt="Normal fonts" />
</p>

### Italic
Expand All @@ -182,18 +188,19 @@ vim.g.onedark_italic_variables = true
```

<p align="center">
<img src="https://imgur.com/8rz9b2b.png" alt="Italic fonts" />
<img src="https://imgur.com/oA5PjUb.png" alt="Italic fonts" />
</p>

### Telescope

<p align="center">
<img src="https://imgur.com/eLs5Og5.png" alt="Telescope plugin" />
<img src="https://imgur.com/vgR9HRe.png" alt="Telescope plugin" />
</p>

## Useful Links

- [SF Mono Nerd-Font](https://github.com/epk/SF-Mono-Nerd-Font)
- [Kitty](https://sw.kovidgoyal.net/kitty)
- ~[SF Mono Nerd-Font](https://github.com/epk/SF-Mono-Nerd-Font)~ [Ubuntu Mono](https://design.ubuntu.com/font/)
- [Wallpaper](https://hdqwalls.com/big-sur-4k-wallpaper)
- [dotfiles](https://github.com/ful1e5/dotfiles)

Expand All @@ -205,6 +212,10 @@ vim.g.onedark_italic_variables = true
<img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" >
</a>

## Self Promotion

Follow me on **[Twitter](https://twitter.com/ful1e5)**

<!-- Ninja -->

<p align="center">
Expand Down
8 changes: 4 additions & 4 deletions extras/kitty_onedark_.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
cursor #abb2bf

# Tabs
active_tab_background #282c34
active_tab_foreground #abb2bf
inactive_tab_background #242b38
inactive_tab_foreground #5c6370
active_tab_background #61afef
active_tab_foreground #282c34
inactive_tab_background #abb2bf
inactive_tab_foreground #282c34
#tab_bar_background #20232A

# normal
Expand Down
8 changes: 2 additions & 6 deletions lua/onedark/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ vim = vim or {g = {}, o = {}}

local function opt(key, default)
key = "onedark_" .. key
if vim.g[key] == nil then
return default
end
if vim.g[key] == 0 then
return false
end
if vim.g[key] == nil then return default end
if vim.g[key] == 0 then return false end
return vim.g[key]
end

Expand Down
12 changes: 3 additions & 9 deletions lua/onedark/extra/alacritty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ function M.alacritty(config)

local alacrittyColors = {}
for k, v in pairs(colors) do
if type(v) == "string" then
alacrittyColors[k] = v:gsub("^#", "0x")
end
if type(v) == "string" then alacrittyColors[k] = v:gsub("^#", "0x") end
end

local alacritty =
util.template(
[[
local alacritty = util.template([[
# onedark Alacritty Colors
colors:
# Default colors
Expand Down Expand Up @@ -50,9 +46,7 @@ colors:
- { index: 16, color: '${orange}' }
- { index: 17, color: '${red1}' }
]],
alacrittyColors
)
]], alacrittyColors)

return alacritty
end
Expand Down
16 changes: 6 additions & 10 deletions lua/onedark/extra/kitty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ function M.kitty(config)
config.transform_colors = true
local colors = require("onedark.colors").setup(config)

local kitty =
util.template(
[[
local kitty = util.template([[
# onedark colors for Kitty
background ${bg}
Expand All @@ -20,10 +18,10 @@ function M.kitty(config)
cursor ${fg}
# Tabs
active_tab_background ${bg}
active_tab_foreground ${fg}
inactive_tab_background ${bg_highlight}
inactive_tab_foreground ${fg_gutter}
active_tab_background ${blue}
active_tab_foreground ${bg}
inactive_tab_background ${fg}
inactive_tab_foreground ${bg}
#tab_bar_background ${black}
# normal
Expand All @@ -49,9 +47,7 @@ function M.kitty(config)
# extended colors
color16 ${orange}
color17 ${red1}
]],
colors
)
]], colors)
return kitty
end

Expand Down
66 changes: 19 additions & 47 deletions lua/onedark/hsluv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE A
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.
]]
local hsluv = {}
]] local hsluv = {}

local hexChars = "0123456789abcdef"

Expand Down Expand Up @@ -62,9 +61,7 @@ hsluv.max_safe_chroma_for_l = function(l)

for i = 1, 6 do
local length = distance_line_from_origin(bounds[i])
if length >= 0 then
min = math.min(min, length)
end
if length >= 0 then min = math.min(min, length) end
end
return min
end
Expand All @@ -77,18 +74,14 @@ hsluv.max_safe_chroma_for_lh = function(l, h)
for i = 1, 6 do
local bound = bounds[i]
local length = length_of_ray_until_intersect(hrad, bound)
if length >= 0 then
min = math.min(min, length)
end
if length >= 0 then min = math.min(min, length) end
end
return min
end

hsluv.dot_product = function(a, b)
local sum = 0
for i = 1, 3 do
sum = sum + a[i] * b[i]
end
for i = 1, 3 do sum = sum + a[i] * b[i] end
return sum
end

Expand Down Expand Up @@ -117,10 +110,11 @@ hsluv.xyz_to_rgb = function(tuple)
end

hsluv.rgb_to_xyz = function(tuple)
local rgbl = {hsluv.to_linear(tuple[1]), hsluv.to_linear(tuple[2]), hsluv.to_linear(tuple[3])}
local rgbl = {
hsluv.to_linear(tuple[1]), hsluv.to_linear(tuple[2]), hsluv.to_linear(tuple[3])
}
return {
hsluv.dot_product(hsluv.minv[1], rgbl),
hsluv.dot_product(hsluv.minv[2], rgbl),
hsluv.dot_product(hsluv.minv[1], rgbl), hsluv.dot_product(hsluv.minv[2], rgbl),
hsluv.dot_product(hsluv.minv[3], rgbl)
}
end
Expand Down Expand Up @@ -155,19 +149,15 @@ hsluv.xyz_to_luv = function(tuple)
varV = 0
end
local L = hsluv.y_to_l(Y)
if L == 0 then
return {0, 0, 0}
end
if L == 0 then return {0, 0, 0} end
return {L, 13 * L * (varU - hsluv.refU), 13 * L * (varV - hsluv.refV)}
end

hsluv.luv_to_xyz = function(tuple)
local L = tuple[1]
local U = tuple[2]
local V = tuple[3]
if L == 0 then
return {0, 0, 0}
end
if L == 0 then return {0, 0, 0} end
local varU = U / (13 * L) + hsluv.refU
local varV = V / (13 * L) + hsluv.refV
local Y = hsluv.l_to_y(L)
Expand All @@ -185,9 +175,7 @@ hsluv.luv_to_lch = function(tuple)
H = 0
else
H = math.atan2(V, U) * 180.0 / 3.1415926535897932
if H < 0 then
H = 360 + H
end
if H < 0 then H = 360 + H end
end
return {L, C, H}
end
Expand All @@ -203,12 +191,8 @@ hsluv.hsluv_to_lch = function(tuple)
local H = tuple[1]
local S = tuple[2]
local L = tuple[3]
if L > 99.9999999 then
return {100, 0, H}
end
if L < 0.00000001 then
return {0, 0, H}
end
if L > 99.9999999 then return {100, 0, H} end
if L < 0.00000001 then return {0, 0, H} end
return {L, hsluv.max_safe_chroma_for_lh(L, H) / 100 * S, H}
end

Expand All @@ -217,12 +201,8 @@ hsluv.lch_to_hsluv = function(tuple)
local C = tuple[2]
local H = tuple[3]
local max_chroma = hsluv.max_safe_chroma_for_lh(L, H)
if L > 99.9999999 then
return {H, 0, 100}
end
if L < 0.00000001 then
return {H, 0, 0}
end
if L > 99.9999999 then return {H, 0, 100} end
if L < 0.00000001 then return {H, 0, 0} end

return {H, C / max_chroma * 100, L}
end
Expand All @@ -231,25 +211,17 @@ hsluv.hpluv_to_lch = function(tuple)
local H = tuple[1]
local S = tuple[2]
local L = tuple[3]
if L > 99.9999999 then
return {100, 0, H}
end
if L < 0.00000001 then
return {0, 0, H}
end
if L > 99.9999999 then return {100, 0, H} end
if L < 0.00000001 then return {0, 0, H} end
return {L, hsluv.max_safe_chroma_for_l(L) / 100 * S, H}
end

hsluv.lch_to_hpluv = function(tuple)
local L = tuple[1]
local C = tuple[2]
local H = tuple[3]
if L > 99.9999999 then
return {H, 0, 100}
end
if L < 0.00000001 then
return {H, 0, 0}
end
if L > 99.9999999 then return {H, 0, 100} end
if L < 0.00000001 then return {H, 0, 0} end
return {H, C / hsluv.max_safe_chroma_for_l(L) * 100, L}
end

Expand Down
Loading

0 comments on commit bf020a4

Please sign in to comment.