Skip to content

Fix: RGB/RGBA color detection with resolved merge conflicts#39

Merged
melihbirim merged 7 commits intomainfrom
fix-pr-36-rgb-colors
Dec 27, 2025
Merged

Fix: RGB/RGBA color detection with resolved merge conflicts#39
melihbirim merged 7 commits intomainfrom
fix-pr-36-rgb-colors

Conversation

@melihbirim
Copy link
Copy Markdown
Owner

Summary

This PR fixes and merges PR #36 with all merge conflicts resolved and formatting issues corrected.

Changes

RGB/RGBA Color Detection

  • Added RGB_COLOR pattern with proper validation (0-255 for RGB, 0-1 for alpha)
  • Implemented isRgbColor() function
  • Integrated into detectFieldType() function

Merge Conflict Resolution

  • Merged RGB_COLOR pattern alongside EMOJI, TIME, and SEMANTIC_VERSION
  • Fixed indentation issues in PATTERNS object
  • Resolved isBoolean() function formatting conflict
  • Fixed brace mismatch in toJSONSchema() function

Documentation & Tests

  • Updated README test count to 99+ (current count after time detection merge)
  • All 99 tests passing (includes 3 new RGB color tests)
  • Linting clean with no errors

Test Coverage

// Valid RGB/RGBA colors
infer('rgb(255, 0, 0)') // ✅ returns 'color'
infer('rgba(0, 255, 0, 0.5)') // ✅ returns 'color'
infer('rgb( 128 , 128 , 128 )') // ✅ handles spacing variations

// Invalid cases properly rejected
infer('rgb(300, 0, 0)') // ✅ returns 'string' (out of range)
infer('rgba(255, 0, 0, 2)') // ✅ returns 'string' (alpha out of range)

Validation

  • ✅ All 99 tests passing
  • npm run lint clean
  • ✅ No merge conflicts
  • ✅ Rebased on latest main

Closes #23

dprateek996 and others added 7 commits December 21, 2025 12:07
- Merged RGB_COLOR pattern with existing EMOJI, TIME, SEMANTIC_VERSION
- Fixed indentation throughout PATTERNS object
- Resolved isBoolean function formatting conflict
- Fixed toJSONSchema function brace mismatch
- Updated test count from 77+ to 99+ in README
- All 99 tests passing (3 new RGB color tests)
- Linting clean
@melihbirim melihbirim merged commit cf06020 into main Dec 27, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RGB/RGBA Color Detector

2 participants