charmtone
charmtone
Crystal port of Charm's experimental charmtone palette package.
charmtone provides:
- A typed color key enum (
Charmtone::Key) for the CharmTone palette. - Name lookup (
to_s) and hex lookup (hex) for each key. - RGBA output (
rgba) compatible with 16-bit channel values. - Palette grouping helpers (
is_primary?,is_secondary?,is_tertiary?). - Canonical palette enumeration via
Charmtone.keys.
Go source of truth:
Installation
-
Add the dependency to your
shard.yml:dependencies: charmtone: github: dsisnero/charmtone -
Run
shards install
Usage
require "charmtone"
Charmtone::Key::Charple.hex # => "#6B50FF"
Charmtone::Key::Mochi.to_s # => "Crystal"
Charmtone::Key::Blush.is_secondary? # => true
r, g, b, a = Charmtone::Key::Zest.rgba
# 16-bit channels (0x0000..0xFFFF)
Charmtone.keys.each do |key|
puts "#{key}: #{key.hex}"
end
Development
Run specs:
CRYSTAL_CACHE_DIR=$PWD/.crystal-cache crystal spec
Contributing
- Fork it (https://github.com/dsisnero/charmtone/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Dom - creator and maintainer
Repository
charmtone
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 1 day ago
- February 11, 2026
License
MIT License
Links
Synced at
Wed, 11 Feb 2026 07:15:35 GMT
Languages