Releases: AnttiRask/col2hex2col
v0.5.3
v0.5.2
What's Changed
Bug Fixes
- Fixed color count test to use
>=threshold instead of exact count, preventing test failures when the color database is updated - Fixed test warning for 8-digit hex codes triggering fallback
Data
- Updated color database with 29 new colors from the color-names repository
Documentation
- Replaced hardcoded "32,462" color count with "32,000+" throughout docs and README
CI/CD
- Fixed update-colors workflow (dependency installation, caching, permissions)
- Simplified workflow to push directly to main
- Re-enabled macOS in R-CMD-check workflow
Full Changelog: v0.5.1...v0.5.2
v0.5.1
What's Changed
Documentation
- Update README
head()output to include LAB columns (lab_l, lab_a, lab_b) - Add note about LAB columns requiring the
farverpackage - Update "Data Export" feature to mention LAB coordinates
- Update color_table_example.png images
- Remove image caption for cleaner pkgdown display
Metadata
- Update contributor name from "iamYannC" to "Yann Cohen"
- Add clickable GitHub link for contributor on pkgdown site
Full Changelog: v0.5.0...v0.5.1
v0.5.0
What's Changed
Bug Fixes
- Fix
hex_to_color()examples to use#859900(a hex code with no exact match in the database) - Fix
get_color_data()row numbering after alphabetical sorting - Fix README examples (correct head() output and blue colors count)
- Fix pkgdown color table image path
Enhancements
create_color_table()now labels LAB columns as "Lab L", "Lab a", "Lab b"create_color_table()automatically renames the first column to "Color Name" regardless of input column name
Full Changelog: v0.4.0...v0.5.0
v0.4.0 - Nearest Color Fallback
What's New
Nearest Color Fallback
hex_to_color() now automatically finds the nearest named color when no exact match exists in the database. This uses LAB color distance for perceptually accurate matching.
# Hex code without exact match - finds nearest named color
hex_to_color("#ABCDEF")
#> [1] "alphabet blue"
# Disable fallback to get NA for unmatched colors
hex_to_color("#ABCDEF", fallback_nearest_color = FALSE)
#> [1] NAPerformance Improvements
- Pre-computed LAB color values with caching in
get_color_data() - Exact match fast path before computing distances
- Efficient color distance calculations
Other Changes
- White/black normalization (gray100 → white, gray0 → black)
- Added
farverandclito Suggests for enhanced functionality
Contributors
Thank you to @iamYannC for contributing the nearest color fallback functionality!
Full Changelog: v0.3.1...v0.4.0
v0.3.1: Support for 8-digit Hex Codes with Alpha Channel
Enhancements
hex_to_color(): Now accepts 8-digit hex codes with alpha channel- Automatically strips alpha channel from #RRGGBBAA format codes
- Maintains backward compatibility with 6-digit #RRGGBB format
- Works seamlessly with paletteer and other packages that output colors with transparency
Testing
- Added 7 new tests for 8-digit hex code support in
hex_to_color() - All 111 tests passing
Installation
# Install from GitHub
devtools::install_github("AnttiRask/col2hex2col@v0.3.1")Example
library(col2hex2col)
# Now works with paletteer output that includes alpha channel
library(paletteer)
paletteer_dynamic("cartography::sand.pal", 20) %>% hex_to_color()🤖 Generated with Claude Code
v0.3.0: Color Data Export and Visualization
New Features
-
get_color_data(): New function to export the complete color database as a data frame- Returns all 32,462 color names with their hex codes
- Data frame format makes it easy to explore, filter, and analyze colors
- Sorted alphabetically by color name
- Perfect for creating custom color palettes or searching for specific colors
-
create_color_table(): New function to create visual color swatch tables- Displays colors with names, hex codes, and visual color swatches
- Uses the gt package for beautiful formatted tables
- Works seamlessly with
get_color_data()output - Optional dependency - only requires gt if you want to use this feature
Dependencies
- Added
gtto Suggests (optional dependency forcreate_color_table()) - Package maintains zero hard dependencies - pure base R for core functions
Testing
- Added 18 new tests for
get_color_data() - Added 8 new tests for
create_color_table()(with proper handling of optional gt dependency) - All 104 tests passing
🤖 Generated with Claude Code
v0.2.0 - Extended Color Database
col2hex2col 0.2.0
Major Features
-
Extended Color Database: Package now supports over 32,000 color names!
- 657 R built-in colors (backward compatible)
- 31,852 colors from the color-names database (MIT license)
- Total: 32,462 unique color names, 32,161 unique hex codes
-
Enhanced color_to_hex(): Now accepts color names from the extended database
- Case-insensitive matching ("red", "Red", "RED" all work)
- Whitespace trimming
- Examples: "sunset orange", "arctic ocean", "forest green"
-
Enhanced hex_to_color(): Intelligently selects color names with prioritization
- R colors are always prioritized when available
- For non-R colors, returns the shortest available name
- Significantly increased hex code coverage (from ~650 to 32,161)
Breaking Changes
- None - fully backward compatible with v0.1.x
- All existing code using R colors will work unchanged
- R colors are prioritized in all lookups
Performance Improvements
- Replaced dynamic color lookup with pre-built internal databases
- Removed dependency on
grDevicesfunctions for lookups - Fast constant-time lookup using named vectors stored in
R/sysdata.rda
Documentation
- Updated all function documentation to reflect extended database
- Added examples using extended color names
- Updated package description and README
- Enhanced package-level documentation with key features
Testing
- Added 22 new tests for extended color functionality
- All 67 tests passing
- Tests cover backward compatibility, case insensitivity, and extended colors
Internal Changes
- Added
data-raw/prepare_colornames.Rscript for data preparation - Internal data stored in
R/sysdata.rda(~650KB) - Removed
grDevicesfrom Imports (no longer needed)
col2hex2col 0.1.2
col2hex2col 0.1.2
Bug Fixes
- Fixed duplicate "Author" and "See Also" sections in package documentation
col2hex2col 0.1.1
col2hex2col 0.1.1
Documentation Improvements
- Enhanced function documentation with comprehensive details
- Added
@detailssections explaining input validation - Expanded examples with real-world use cases
- Added cross-references with
@seealsosections - Improved package-level documentation
- All examples verified to run correctly