Skip to content

Commit f414fb5

Browse files
committed
refactor(Color): improve Color lib (types, etc.)
- 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`.
1 parent cbe229b commit f414fb5

File tree

3 files changed

+174
-120
lines changed

3 files changed

+174
-120
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Improved highlight-group overrides (#349)
1414
- Assigning `false` or an empty table to a highlight group clears it
1515
- Assigning `false` to groups/specs/palettes clears previous settings from the config store
16-
- Loading/sourcing colorscheme now causes recompilation if config or overrides changed, even if `setup()` has been called before
16+
- Loading/sourcing colorscheme now causes recompilation if config or overrides changed, even if `setup()` was called before
17+
- Refactored and improved `Color` lib (LSP types and descriptions, code-dedupe, stricter ctor, etc.) (#352)
1718

1819
### Changes
1920

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

0 commit comments

Comments
 (0)