Skip to content

Releases: AnttiRask/col2hex2col

v0.5.3

17 Feb 23:53

Choose a tag to compare

col2hex2col 0.5.3

Administrative

  • Added LICENSE.md file so GitHub correctly displays the MIT license
  • Updated LICENSE year to 2026
  • Added copyright holder ([cph]) role to Authors@R in DESCRIPTION
  • Fixed Authors@R comment format for contributor Yann Cohen

v0.5.2

07 Feb 00:13

Choose a tag to compare

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

24 Jan 13:39

Choose a tag to compare

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 farver package
  • 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

24 Jan 13:07

Choose a tag to compare

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

24 Jan 09:18

Choose a tag to compare

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] NA

Performance 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 farver and cli to 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

04 Jan 00:53

Choose a tag to compare

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

03 Jan 23:58

Choose a tag to compare

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 gt to Suggests (optional dependency for create_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

03 Jan 22:53

Choose a tag to compare

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 grDevices functions 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.R script for data preparation
  • Internal data stored in R/sysdata.rda (~650KB)
  • Removed grDevices from Imports (no longer needed)

col2hex2col 0.1.2

30 Dec 00:32

Choose a tag to compare

col2hex2col 0.1.2

Bug Fixes

  • Fixed duplicate "Author" and "See Also" sections in package documentation

col2hex2col 0.1.1

30 Dec 00:28

Choose a tag to compare

col2hex2col 0.1.1

Documentation Improvements

  • Enhanced function documentation with comprehensive details
  • Added @details sections explaining input validation
  • Expanded examples with real-world use cases
  • Added cross-references with @seealso sections
  • Improved package-level documentation
  • All examples verified to run correctly