83 Commits

Author SHA1 Message Date
Connor Skees
150ba14b74 clippy 2021-07-03 19:15:31 -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
5efe99a404 resolve merge conflicts with master 2020-08-02 15:11:59 -04:00
Ivan Tham
4a9c200a7e remove alpha from get_by_name 2020-08-02 15:03:55 -04:00
Ivan Tham
edec89093b use phf for named rgba map hashing
Improves many_named_colors benchmark by ~40%.

many_named_colors       time:   [897.66 us 900.05 us 903.05 us]
                        change: [-41.299% -40.114% -38.800%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
2020-08-02 15:03:55 -04:00
Connor Skees
db41737ec7 hue can never be exactly 360 2020-08-02 15:03:26 -04:00
Connor Skees
28701b2707 Merge branch 'master' of https://github.com/connorskees/grass into modules 2020-08-01 15:12:24 -04:00
Ivan Tham
d68ffd6510 remove alpha from get_by_name 2020-08-01 14:57:15 -04:00
Ivan Tham
7fe3abc625 use phf for named rgba map hashing
Improves many_named_colors benchmark by ~40%.

many_named_colors       time:   [897.66 us 900.05 us 903.05 us]
                        change: [-41.299% -40.114% -38.800%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
2020-08-01 14:57:15 -04:00
Connor Skees
53cf2816e0 use None to represent NaN 2020-07-26 19:38:41 -04:00
Connor Skees
a379d870fc remove Hash impl for Value 2020-07-10 00:17:15 -04:00
Connor Skees
eb50381236 color equality only checks rgba value and normalizes channels 2020-07-07 12:30:33 -04:00
Connor Skees
57562b52d3 map equality is independent of order 2020-07-07 01:06:22 -04:00
Connor Skees
65f93ad6d5 builtin fns red, green, and blue round their output 2020-07-04 18:46:23 -04:00
ConnorSkees
369feb5c40 use clearer naming for Number variants 2020-06-26 08:47:10 -04:00
ConnorSkees
2887016ceb tidy documentation
standardize capitalization of "Sass" and make updates to reflect new
0.9.0 API
2020-06-20 06:31:43 -04:00
ConnorSkees
c1b5ff5730 prettify imports 2020-06-16 20:00:11 -04:00
ConnorSkees
8390fd8354 resolve clippy lints 2020-05-31 18:21:20 -04:00
ConnorSkees
6d76e1518a refactor away many unwraps 2020-05-25 00:57:59 -04:00
ConnorSkees
bb89a865d4 remove clones when paring hsla colors 2020-05-24 07:42:42 -04:00
ConnorSkees
969726eb30 Revert string interning
There existed issues related to multithreaded tests that are difficult
to resolve. In the future interning may be reimplemented but in a more
limited capacity.

The motivation behind interning *values* was that it appeared checking
for named colors was responsible for much of the time lost when parsing
unquoted strings. If interning were to be reimplemented, it may make
sense to limit it solely to identifiers and style properties.
2020-05-22 14:20:31 -04:00
ConnorSkees
9a6c8ce019 add string interning
this seems to improve performance by ~20% as well as significantly
decrease memory usage
2020-05-21 22:46:40 -04:00
ConnorSkees
dc5df157b0 replace macro with fn 2020-05-20 23:56:17 -04:00
ConnorSkees
45a29c9697 refactor Number::to_integer 2020-05-20 22:40:21 -04:00
ConnorSkees
bea90060a8 minor cleanup 2020-05-20 00:14:55 -04:00
ConnorSkees
8520048b26 implement small int optimizations
This allows for numbers within 18 digits of precision (the vast
majority of numbers) to be represented by just 2 i64s rather than 2 heap
allocated BigInts. In the future these optimizations may become more
aggressive and granular, but for now `grass` is already more than an order of
magnitude faster than `dart-sass`.
2020-05-19 23:23:04 -04:00
ConnorSkees
cf987abb53 remove bimap in favor of ad hoc structure 2020-05-19 19:13:49 -04:00
ConnorSkees
d4f67b5ed9 clippy 2020-05-16 18:38:37 -04:00
ConnorSkees
a6e03e4ae1 reduce nesting in ident parsing 2020-04-30 16:02:40 -04:00
ConnorSkees
bc09e49c89 remove is_float field of ParsedNumber 2020-04-28 15:28:50 -04:00
ConnorSkees
bcbf3f4a90 clippy 2020-04-28 15:14:44 -04:00
ConnorSkees
269f37034a clippy 2020-04-28 08:27:35 -04:00
ConnorSkees
f158f03708 better handle named color transparent 2020-04-26 22:51:38 -04:00
ConnorSkees
af7e236ca3 refactor named colors into bidirectional map 2020-04-26 22:23:55 -04:00
ConnorSkees
4d989b60b1 remove final clamp! macro 2020-04-22 06:05:19 -04:00
ConnorSkees
d480e60628 replace clamp! macro with builtin method 2020-04-21 17:59:40 -04:00
ConnorSkees
a5b54e3ed0 toplevel docs for color module 2020-04-17 13:16:15 -04:00
ConnorSkees
de78c1147a manually resolve some formatting issues 2020-04-17 13:06:54 -04:00
ConnorSkees
0be8828bf0 make better use of num traits 2020-03-22 22:28:54 -04:00
ConnorSkees
4954f4bc6a better docs for colors 2020-03-19 16:40:30 -04:00
ConnorSkees
53861ccb0d clippy 2020-02-22 17:57:13 -05:00
ConnorSkees
87579b181b clippy 2020-02-16 18:03:19 -05:00
ConnorSkees
948c489785 Properly implement weighted inversion 2020-02-16 16:53:28 -05:00
ConnorSkees
5f59c71752 Bounds checking macro for builtin functions 2020-02-16 15:14:14 -05:00
ConnorSkees
fcb5069f82 Keep track of original values given from hsla() 2020-02-16 15:06:02 -05:00
ConnorSkees
639fa99abc Split Color into HSLA and RGBA representations 2020-02-16 14:19:04 -05:00
ConnorSkees
0e53318c9e Add named color transparent 2020-02-16 12:23:08 -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
c16d6fed4e clippy 2020-02-14 18:28:09 -05:00