Skip to content

Commit

Permalink
refactor(Color): improve Color lib (types, etc.)
Browse files Browse the repository at this point in the history
- Fixup types and doc-comment descriptions. The `Color` module and
  `Color` instances are now well-typed providing LSP completion and
  type-hinting. The `Color` type has been renamed and namspaced under
  `GhTheme.*`. Types provided by the `Color` module are namespaced under
  `GhTheme.Color.*`. The reason for the namespacing is because the Lua
  LSP considers all defined types to be global.

- Remove duplicated code in `__call` and `new()`.

- Throw an error if the argument given to the `Color` constructor is of
  invalid type. Previously there was no error and it just returned
  `nil`.
  • Loading branch information
tmillr committed Jul 17, 2024
1 parent cbe229b commit ecb2c9b
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 165 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved highlight-group overrides (#349)
- Assigning `false` or an empty table to a highlight group clears it
- Assigning `false` to groups/specs/palettes clears previous settings from the config store
- Loading/sourcing colorscheme now causes recompilation if config or overrides changed, even if `setup()` has been called before
- Loading/sourcing colorscheme now causes recompilation if config or overrides changed, even if `setup()` was called before
- Refactored and improved `Color` lib (LSP types and descriptions, code-dedupe, stricter ctor, etc.) (#352)

### Changes

Expand All @@ -27,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Closed #292 (no longer valid, fixed)
- fix(config): `options.darken.floats` is not used (#345)
- fix(compiler): consider entire config when hashing (#350) (related-to #262, #340, #341)
- fix(compiler): always write hash to filesystem when compilation occurs incl. when `require('github-theme').compile()` is called directly (#350)
- fix(compiler): always write hash to fs when compile occurs incl. when `require('github-theme').compile()` is called directly (#350)
- Fixed #340 and #341 (broken/outdated `overrides` example in docs)
- Fixed floats not transparent when `transparent = true` (#337 fixed-by #351)
- fix(Color): `Color.from_hsv()` is used for HSL
Expand Down
Loading

0 comments on commit ecb2c9b

Please sign in to comment.