Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroCorp committed Apr 12, 2022
1 parent f652b95 commit 9441351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ echo $ratio; // 15.0

$cie76_distance = Distance::CIE76($rgb, $hex2);
$cie76_distance = Distance::CIE76('rgba(55,155,255,1)', '#2d78c8'); // Outputs the same thing, Factory is built-in to all comparison functions
echo $cie76_distance; // 55.894680426674
echo $cie76_distance; // 55.89468042667388

$cie94_distance = Distance::CIE94($rgb, $hex2);
echo $cie94_distance; // 13.490919427908
echo $cie94_distance; // 13.49091942790753

$cie94_textiles_distance = Distance::CIE94($rgb, $hex2, 1); // Third parameter optionally sets the application type (0 = Graphic Arts [Default], 1 = Textiles)
echo $cie94_textiles_distance; // 7.0926538068477

$ciede2000_distance = Distance::CIEDE2000($rgb, $hex2);
echo $ciede2000_distance; // 12.711957696301
echo $ciede2000_distance; // 12.711957696300898
```

## Support us
Expand Down
12 changes: 6 additions & 6 deletions tests/DistanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public function it_can_compare_distance_using_CIE76()
$color2 = Hex::fromString('#2d78c8');
$distance = Distance::CIE76($color1, $color2);

$this->assertSame(55.894680426674, $distance);
$this->assertSame(55.89468042667388, $distance);
}

/** @test */
public function it_can_compare_distance_using_CIE76_and_string_colors()
{
$distance = Distance::CIE76('rgb(55,155,255)', '#2d78c8');

$this->assertSame(55.894680426674, $distance);
$this->assertSame(55.89468042667388, $distance);
}

/** @test */
Expand All @@ -34,15 +34,15 @@ public function it_can_compare_distance_using_CIE94()
$color2 = Hex::fromString('#2d78c8');
$distance = Distance::CIE94($color1, $color2);

$this->assertSame(13.490919427908, $distance);
$this->assertSame(13.49091942790753, $distance);
}

/** @test */
public function it_can_compare_distance_using_CIE94_and_string_colors()
{
$distance = Distance::CIE94('rgb(55,155,255)', '#2d78c8');

$this->assertSame(13.490919427908, $distance);
$this->assertSame(13.49091942790753, $distance);
}

/** @test */
Expand All @@ -52,14 +52,14 @@ public function it_can_compare_distance_using_CIEDE2000()
$color2 = Hex::fromString('#2d78c8');
$distance = Distance::CIEDE2000($color1, $color2);

$this->assertSame(12.711957696301, $distance);
$this->assertSame(12.711957696300898, $distance);
}

/** @test */
public function it_can_compare_distance_using_CIEDE2000_and_string_colors()
{
$distance = Distance::CIEDE2000('rgb(55,155,255)', '#2d78c8');

$this->assertSame(12.711957696301, $distance);
$this->assertSame(12.711957696300898, $distance);
}
}

0 comments on commit 9441351

Please sign in to comment.