huerd 0.6.1
Bug Fixes
-
plot_palette_analysis()now returnsinvisible(NULL)without warning when fewer than two colors are supplied. -
simulate_palette_cvd()returns empty results silently when input contains no valid colors. -
plot_cvd_comparison()now preserves the fallback border color when color conversion fails. - Optimizers validate inputs and return structured results instead of failing on invalid inputs (
optimize_colors_constrained(),optimize_colors_sann()).
huerd 0.6.0
Bug Fixes
- Fixed hex color validation regex in
evaluate_palette()to properly reject literal “NA” strings while allowing actual NA values - Fixed flaky test in
test-optimization-core.Rfor nlopt_neldermead optimizer performance expectations - Fixed
reproduce_palette()to properly restore RNG state usingwithr::with_preserve_seed()instead of direct.Random.seedmanipulation - Fixed
validate_oklab_matrix()test errors by properly initializing validation_result structure
Code Quality Improvements
- Added comprehensive documentation to internal helper functions with @param descriptions
- Improved error handling and validation in
export_palette()for different export formats (JSON, CSV, CSS, Sass) - Enhanced L-BFGS optimizer state consistency by adding
colors_oklabfield and defensive clamping - Updated all tests to use testthat 3rd edition describe/it BDD pattern (1,006+ tests)
- Fixed CVD analysis tests to handle list structure return from
simulate_palette_cvd()
New Features
- Added
quick_palette()for one-line palette generation - Added
brand_palette()for brand color integration - Added
export_palette()with support for JSON, CSV, CSS, and Sass formats - Added
interpret_palette_quality()for palette quality assessment - Added
plot.huerd_palette()method with “swatches” and “analysis” plot types - Added ggplot2 integration:
scale_color_huerd(),scale_fill_huerd(),scale_colour_huerd()
huerd 0.5.3
Code Quality Improvements
This release focuses on code quality, maintainability, and consistency improvements identified through comprehensive code review.
User Messaging
- Replaced
cat()calls with semanticclimessaging functions (cli_alert_info(),cli_alert_warning(),cli_alert_success(),cli_inform()) for better user experience - Added
clito package Imports
Code Organization
- Added named constants for magic numbers:
.CANDIDATE_POOL_BASE,.MIN_DISTANCE_THRESHOLD,.OKLAB_TOLERANCE - Extracted repeated clamping code to
.clamp_to_bounds()helper function - Added
@paramdocumentation to internal helper functions - Removed dead/commented-out code
API Consistency
- Added
...parameter to exported functions for future extensibility - Fixed
simulate_palette_cvd()to always return a named list for consistent API behavior
huerd 0.5.2 (2025-07-21)
Bug Fixes
- Corrected distance matrix calculation in smooth optimization objectives where diagonal masking affected only element [1,1] rather than the full diagonal
- Eliminated redundant distance calculations by using
dist()output directly instead of symmetric matrix conversion - Applied log-sum-exp numerical stability technique for robust computation under extreme parameter values
- Added regression tests for distance calculation correctness
huerd 0.5.0 (2025-07-07)
New Features
API Changes
- Added
optimizer = "nlopt_lbfgs"option for L-BFGS optimization - Added
weights = c(smooth_repulsion = 1)andweights = c(smooth_logsumexp = 1)for smooth objectives
Bug Fixes
- Fixed critical bug where L-BFGS optimizer always used
smooth_repulsionobjective regardless ofweightsparameter - Fixed crash in
evaluate_palette_quality()when called directly with hex colors (“argument is of length zero” error) - Both smooth objectives (
smooth_repulsionandsmooth_logsumexp) now work correctly and produce different optimization results
huerd 0.4.2 (2025-07-07)
huerd 0.4.0 (2025-07-06)
Major Changes
Replaced base R graphics with grid graphics system.
plot_palette_analysis()now usesgridExtra::arrangeGrob()for layout.Converted all plotting functions to return grob objects instead of drawing directly.
New Features
Added reproducibility system for palette generation with metadata storage.
Added hue order reversal detection for CVD analysis.
Breaking Changes
Removed
new_device,device_width, anddevice_heightparameters fromplot_palette_analysis().Moved
gridExtrafrom Suggests to Imports, addedgridto Imports.Removed helper functions:
.create_graphics_device,.is_ragg_available,.is_interactive_ide,calculate_safe_margins.
huerd 0.3.1 (2025-07-04)
New Features
- Added automated font size scaling to
plot_palette_analysis()that automatically adjusts text sizes based on device dimensions.
huerd 0.3.0 (2025-07-04)
Major Changes
- Multi-optimizer framework: The
generate_palette()function now supports four different optimization algorithms through the newoptimizerparameter:-
"nloptr_cobyla"(default): Deterministic optimization with constraint handling -
"sann": Stochastic simulated annealing -
"nlopt_direct": Deterministic global optimization using DIRECT algorithm -
"nlopt_neldermead": Derivative-free local optimization using Nelder-Mead simplex
-
- Added automatic font scaling to
plot_palette_analysis()that prevents text overlap and out-of-frame issues.
huerd 0.1.0 (2025-07-01)
This is a major refactoring and simplification of huerd, focusing the package on a single, scientifically-grounded objective: pure minimax color palette generation.
Major Changes
Pure minimax optimization: The core
generate_palette()function has been streamlined to use a pure minimax objective, maximizing the minimum perceptual distance between colors in the OKLAB space. All complex multi-objective parameters (optimize_for,balance_weights,aesthetic_penalty_weights_LC) have been removed, simplifying the API and aligning the package with a clear, defensible scientific goal.Comprehensive diagnostic dashboard: A new
plot_palette_analysis()function has been added. It provides a comprehensive, six-panel diagnostic dashboard inspired byscicomapfor in-depth palette analysis. This feature uses only base R graphics and introduces zero new dependencies.Automatic brightness sorting: All palettes generated by
generate_palette()are now automatically sorted by their OKLAB lightness value, ensuring intuitive and consistent ordering from darkest to lightest.Simplified evaluation: The
evaluate_palette()function is now a pure data provider, returning raw, objective metrics (distances, CVD safety, color distribution) without any subjective heuristic scoring.
Minor Changes
- The
is_cvd_safe()function now uses the more robustevaluate_palette()function for its calculations. - The print methods for
huerd_paletteandhuerd_evaluationhave been updated to reflect the new, simplified data structures.
Removals
The following experimental and non-essential features have been removed to streamline the package:
- Force-field and repulsion-based optimization algorithms.
- Palette animation framework.
- Algorithm comparison tools.
- Post-hoc CVD refinement steps.
- 3D color space visualizations.
- All functionality related to the CAM16 and CIECAM16 color models.
huerd 0.0.3 (2025-06-22)
- Added a post-hoc
cvd_adjustmentstep to improve palettes for color vision deficiency. - Added a
README.mdwith basic usage instructions.
