Skip to content

Commit 5e219f4

Browse files
pftgqwencoder
andcommitted
fix: address Sourcery AI review comments
- Fix dsl.rb YARD: RGB 0-441 → RGBA 0-510 to match updated docs - Fix README: rename "Raw RGB tolerance" to "Tolerance-based comparison" - Fix typo: "allow" → "allows" in configuration.md Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent 9c6cc49 commit 5e219f4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ If you see inconsistent results, choose a color comparison method:
103103
# Option 1: Perceptual (recommended, VIPS only)
104104
Capybara::Screenshot::Diff.perceptual_threshold = 2.0
105105

106-
# Option 2: Raw RGB tolerance (legacy)
106+
# Option 2: Tolerance-based comparison (legacy)
107107
Capybara::Screenshot::Diff.tolerance = 0.0005
108108

109109
# Always set window_size for consistent dimensions

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
| Standard Rails apps | 0.001 (default) | 15 | 1s |
3030
| Pixel-perfect design tests | 0.0001 | 5 | 1s |
3131

32-
**Note:** VIPS defaults to `tolerance: 0.001` (allow 0.1% pixel difference). ChunkyPNG has no default tolerance.
32+
**Note:** VIPS defaults to `tolerance: 0.001` (allows 0.1% pixel difference). ChunkyPNG has no default tolerance.
3333

3434
## Choosing the Right Color Comparison Method
3535

lib/capybara_screenshot_diff/dsl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def screenshot_group(name)
4343
# @option options [Numeric] :tolerance (0.001 for :vips driver) Color tolerance for comparison.
4444
# Represents the maximum allowed ratio of different pixels (0.0-1.0 scale).
4545
# @option options [Numeric] :color_distance_limit Maximum allowed color distance between pixels.
46-
# Uses Euclidean RGB distance (0-441 scale). Mutually exclusive with :perceptual_threshold.
46+
# Uses Euclidean RGBA distance (0-510 scale). Mutually exclusive with :perceptual_threshold.
4747
# @option options [Numeric] :perceptual_threshold Maximum perceptual color difference (CIE dE00).
4848
# Uses human perception-based scale (0-100+). VIPS only. Takes priority over :color_distance_limit if both set.
4949
# @option options [Numeric] :shift_distance_limit Maximum allowed shift distance for pixels.

0 commit comments

Comments
 (0)