-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add better tests for the bounds of legacy color space constructors (#…
- Loading branch information
Showing
4 changed files
with
358 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<===> README.md | ||
The W3C tests cover out-of-bounds hue, but not saturation or lightness. | ||
|
||
<===> | ||
================================================================================ | ||
<===> saturation/above/input.scss | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(hsl(0, 200%, 50%)); | ||
|
||
<===> saturation/above/output.css | ||
a { | ||
value: hsl(0, 200%, 50%); | ||
space: hsl; | ||
channels: 0deg 200% 50% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> saturation/below/input.scss | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(hsl(0, -100%, 50%)); | ||
|
||
<===> saturation/below/output.css | ||
a { | ||
value: hsl(0, 0%, 50%); | ||
space: hsl; | ||
channels: 0deg 0% 50% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> lightness/above/input.scss | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(hsl(0, 100%, 500%)); | ||
|
||
<===> lightness/above/output.css | ||
a { | ||
value: hsl(0, 100%, 500%); | ||
space: hsl; | ||
channels: 0deg 100% 500% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> lightness/below/input.scss | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(hsl(0, 100%, -100%)); | ||
|
||
<===> lightness/below/output.css | ||
a { | ||
value: hsl(0, 100%, -100%); | ||
space: hsl; | ||
channels: 0deg 100% -100% / 1; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
<===> whiteness/above/blackness/zero/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 150%, 0%)); | ||
|
||
<===> whiteness/above/blackness/zero/output.css | ||
a { | ||
value: white; | ||
space: hwb; | ||
channels: 0deg 100% 0% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/above/blackness/mid/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 150%, 10%)); | ||
|
||
<===> whiteness/above/blackness/mid/output.css | ||
a { | ||
value: hsl(0, 0%, 93.75%); | ||
space: hwb; | ||
channels: 0deg 93.75% 6.25% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/above/blackness/above/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 150%, 120%)); | ||
|
||
<===> whiteness/above/blackness/above/output.css | ||
a { | ||
value: hsl(0, 0%, 55.5555555556%); | ||
space: hwb; | ||
channels: 0deg 55.5555555556% 44.4444444444% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/above/blackness/below/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 150%, -20%)); | ||
|
||
<===> whiteness/above/blackness/below/output.css | ||
a { | ||
value: hsl(0, 0%, 115.3846153846%); | ||
space: hwb; | ||
channels: 0deg 115.3846153846% -15.3846153846% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/below/blackness/zero/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -50%, 0%)); | ||
|
||
<===> whiteness/below/blackness/zero/output.css | ||
a { | ||
value: hsl(0, 300%, 25%); | ||
space: hwb; | ||
channels: 0deg -50% 0% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/below/blackness/mid/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -50%, 10%)); | ||
|
||
<===> whiteness/below/blackness/mid/output.css | ||
a { | ||
value: hsl(0, 350%, 20%); | ||
space: hwb; | ||
channels: 0deg -50% 10% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/below/blackness/above/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -50%, 120%)); | ||
|
||
<===> whiteness/below/blackness/above/output.css | ||
a { | ||
value: hsl(180, 42.8571428571%, -35%); | ||
space: hwb; | ||
channels: 0deg -50% 120% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> whiteness/below/blackness/below/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -50%, -20%)); | ||
|
||
<===> whiteness/below/blackness/below/output.css | ||
a { | ||
value: hsl(0, 242.8571428571%, 35%); | ||
space: hwb; | ||
channels: 0deg -50% -20% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/above/whiteness/zero/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 0%, 150%)); | ||
|
||
<===> blackness/above/whiteness/zero/output.css | ||
a { | ||
value: black; | ||
space: hwb; | ||
channels: 0deg 0% 100% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/above/whiteness/mid/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 10%, 150%)); | ||
|
||
<===> blackness/above/whiteness/mid/output.css | ||
a { | ||
value: hsl(0, 0%, 6.25%); | ||
space: hwb; | ||
channels: 0deg 6.25% 93.75% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/above/whiteness/above/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 120%, 150%)); | ||
|
||
<===> blackness/above/whiteness/above/output.css | ||
a { | ||
value: hsl(0, 0%, 44.4444444444%); | ||
space: hwb; | ||
channels: 0deg 44.4444444444% 55.5555555556% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/above/whiteness/below/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -20%, 150%)); | ||
|
||
<===> blackness/above/whiteness/below/output.css | ||
a { | ||
value: hsl(0, 0%, -15.3846153846%); | ||
space: hwb; | ||
channels: 0deg -15.3846153846% 115.3846153846% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/below/whiteness/zero/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 0%, -50%)); | ||
|
||
<===> blackness/below/whiteness/zero/output.css | ||
a { | ||
value: hsl(0, 300%, 75%); | ||
space: hwb; | ||
channels: 0deg 0% -50% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/below/whiteness/mid/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 10%, -50%)); | ||
|
||
<===> blackness/below/whiteness/mid/output.css | ||
a { | ||
value: hsl(0, 350%, 80%); | ||
space: hwb; | ||
channels: 0deg 10% -50% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/below/whiteness/above/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, 120%, -50%)); | ||
|
||
<===> blackness/below/whiteness/above/output.css | ||
a { | ||
value: hsl(180, 42.8571428571%, 135%); | ||
space: hwb; | ||
channels: 0deg 120% -50% / 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> blackness/below/whiteness/below/input.scss | ||
@use 'sass:color'; | ||
@use 'core_functions/color/utils'; | ||
@include utils.inspect(color.hwb(0, -20%, -50%)); | ||
|
||
<===> blackness/below/whiteness/below/output.css | ||
a { | ||
value: hsl(0, 242.8571428571%, 65%); | ||
space: hwb; | ||
channels: 0deg -20% -50% / 1; | ||
} |
Oops, something went wrong.