83 Commits

Author SHA1 Message Date
Connor Skees
ffaee04613
rewrite parsing, evaluation, and serialization (#67)
Adds support for the indented syntax, plain CSS imports, `@forward`, and many other previously missing features.
2022-12-26 15:33:04 -05:00
Connor Skees
1517acb188 move hsla tests to separate file 2021-08-15 23:26:27 -04:00
Connor Skees
ebccebfed1 support 2 arg special rgb/rgba 2021-07-30 06:44:29 -04:00
Connor Skees
2a7f0b6dbc support single arg special color fns 2021-07-30 06:25:12 -04:00
Connor Skees
1e2e32140b refactor parsing of special hsl/rgb fns 2021-07-30 06:15:22 -04:00
Connor Skees
fba42df43b test for hue when largest channel is blue 2021-07-21 22:07:03 -04:00
Connor Skees
be9eb8e0b0 improve code coverage
also identified dead code and a bug in saturation and hue fns
2021-07-14 01:40:11 -04:00
Connor Skees
884b92f476 remove test macro shorthand for unchanged output 2020-11-20 04:34:36 -05:00
Connor Skees
27eeaeef08 plain-css invert accepts numbers of any unit 2020-11-16 03:09:40 -05:00
Connor Skees
d2a39e274d add ignored interpolated color test 2020-08-17 04:20:01 -04:00
Connor Skees
a7b6675c18 unignore variable casing grayscale test 2020-08-17 02:43:52 -04:00
Connor Skees
a7eb78d249 fix bug in generating complement for colors with hue under 180deg 2020-08-17 02:21:21 -04:00
Connor Skees
a665cb13cc remove cfg(test) from test files 2020-08-11 20:22:24 -04:00
Connor Skees
9e2397ce8d refactor !important tests into separate file 2020-08-11 14:58:41 -04:00
Connor Skees
db41737ec7 hue can never be exactly 360 2020-08-02 15:03:26 -04:00
Connor Skees
f587a36367 fix regression involving min and max inside color functions 2020-07-29 08:27:53 -04:00
Connor Skees
6631b8ae0e correctly parse the function filter syntax 2020-07-28 18:09:23 -04:00
Connor Skees
e915e5cd31 test for hsla conversion to named color 2020-07-07 14:14:05 -04:00
Connor Skees
eb50381236 color equality only checks rgba value and normalizes channels 2020-07-07 12:30:33 -04:00
Connor Skees
65f93ad6d5 builtin fns red, green, and blue round their output 2020-07-04 18:46:23 -04:00
ConnorSkees
402d7bf8e6 unignore passing tests 2020-06-23 04:28:54 -04:00
ConnorSkees
5d5e7adb98 more accurately parse strange hex colors 2020-06-18 18:22:58 -04:00
ConnorSkees
76290a4159 further refactor parsing of hex colors 2020-06-18 18:22:58 -04:00
ConnorSkees
3552fbcb99 allow negative values in single arg hsl/hsla 2020-06-03 21:23:33 -04:00
ConnorSkees
29f7b286b0 handle negative values in 1arg rgba? 2020-06-02 17:06:31 -04:00
ConnorSkees
1d518efeaf refactor lowercasing of idents
avoid creating more strings than necessary
2020-04-30 19:43:59 -04:00
ConnorSkees
f158f03708 better handle named color transparent 2020-04-26 22:51:38 -04:00
ConnorSkees
637dc39544 prefer #[ignore] over commenting out tests 2020-04-25 12:16:10 -04:00
ConnorSkees
7181077163 interchangeable underscore/hyphen in builtin functions 2020-04-13 12:57:25 -04:00
ConnorSkees
dee4462cc7 add sass color spec tests verbatim 2020-04-04 14:13:37 -04:00
ConnorSkees
01c1cf3bb3 prefer the word lightness over luminance 2020-03-23 12:52:23 -04:00
ConnorSkees
6460c97ef4 better error messages for zero arg hsl(a) 2020-03-22 23:41:02 -04:00
ConnorSkees
6aae433d21 better error message for missing rgb/rgba args 2020-03-22 23:28:19 -04:00
ConnorSkees
20f702b40b Implement 1 arg for hsl and hsla 2020-03-19 23:44:53 -04:00
ConnorSkees
8a811dae9e Properly parse spaced lists 2020-03-19 21:40:36 -04:00
ConnorSkees
404c7fb66a Various tests 2020-02-24 09:38:05 -05:00
ConnorSkees
42cbd685d3 Refactor how function call args are parsed 2020-02-16 21:34:52 -05:00
ConnorSkees
f57da880b6 fmt 2020-02-16 17:49:37 -05:00
ConnorSkees
d4dd360682 Handle number passed to invert() 2020-02-16 17:00:31 -05:00
ConnorSkees
948c489785 Properly implement weighted inversion 2020-02-16 16:53:28 -05:00
ConnorSkees
ca0e2d47cb Grayscale function behaves differently when given a number 2020-02-16 16:11:24 -05:00
ConnorSkees
fcb5069f82 Keep track of original values given from hsla() 2020-02-16 15:06:02 -05:00
ConnorSkees
6d0686866e hsla doesn't care about units 2020-02-16 10:28:33 -05:00
ConnorSkees
72ae82b6c5 Create test for interchangable - _ in builtins 2020-02-15 11:47:37 -05:00
ConnorSkees
3823a0f9cd Use same implementation for rgb() and rgba() 2020-02-15 07:06:45 -05:00
ConnorSkees
4702461fe7 Allow 3 arguments in rgba() 2020-02-15 07:00:24 -05:00
ConnorSkees
46e4ccd5f9 Allow alpha in hsl() 2020-02-15 06:55:20 -05:00
ConnorSkees
a35fa119e0 Implement builtin function ie-hex-str() 2020-02-14 20:34:12 -05:00
ConnorSkees
19f59efd98 Handle alpha over 1 (a little bit) 2020-02-14 20:13:58 -05:00
ConnorSkees
bb7e47a4fb Implement builtin function scale-color() 2020-02-14 19:51:24 -05:00