Skip to content

feat: fix bugs on functions rgb2int and int2rgb#3

Merged
mlightcad merged 1 commit intomainfrom
fix/color
Mar 6, 2026
Merged

feat: fix bugs on functions rgb2int and int2rgb#3
mlightcad merged 1 commit intomainfrom
fix/color

Conversation

@mlightcad
Copy link
Owner

Summary

This PR fixes incorrect RGB integer conversion behavior and adds a release workflow for GitHub and npm.

Changes

  • fix rgb2int to encode colors in 0xRRGGBB order
  • fix int2rgb to decode integers from 0xRRGGBB correctly
  • update unit tests for color conversion utilities
  • add tools/release.mjs to create and push semver tags
  • add GitHub Actions workflow to publish the package to npm on v* tags
  • add GitHub Actions workflow to create GitHub Releases on v* tags
  • bump package version from 1.3.2 to 1.3.3
  • add npm run release script

Why

The previous color conversion logic swapped red and blue channels, which caused incorrect conversion results between RGB tuples and integer color values.

This PR also standardizes the release process so tagged releases can publish to npm and generate GitHub Releases automatically.

Testing

  • updated existing tests for rgb2int and int2rgb
  • existing test suite runs through pnpm test

Notes

  • release workflows are triggered by tags matching v*
  • npm publishing requires NPM_TOKEN to be configured in repository secrets

@mlightcad mlightcad self-assigned this Mar 6, 2026
@mlightcad mlightcad added the bug Something isn't working label Mar 6, 2026
@mlightcad mlightcad merged commit c2a50e8 into main Mar 6, 2026
1 check passed
@mlightcad mlightcad deleted the fix/color branch March 6, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant