Add optional debug logging capability to track when invalid RGB values are corrected in pdf_write_color and similar functions.
Proposed Implementation
- Add optional debug flag or compile-time option
- Log when NaN, infinity, or out-of-range values are corrected
- Include context (calling function, original values, corrected values)
- Could help developers identify issues in their color mapping algorithms
Benefits
- Easier debugging of color-related issues
- Better visibility into edge cases
- Helps users understand when their data produces invalid colors
- Non-intrusive (only active in debug mode)
This is a non-critical enhancement for developer experience.