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
ConnorSkees
ae9b97a6b2
Properly handle hue values above and below maximum
2020-02-14 18:02:48 -05:00
ConnorSkees
4303bd451c
Handle negative hues
2020-02-14 17:52:25 -05:00
ConnorSkees
a328617001
Implement builtin function change-color()
2020-02-14 17:38:10 -05:00
ConnorSkees
af95658953
Implement builtin function mix()
2020-02-14 16:56:23 -05:00
ConnorSkees
c04f83ddcf
Refactor Color functions into multiple impl
blocks
2020-02-14 15:22:39 -05:00
ConnorSkees
3af2292d5b
Implement builtin function complement()
2020-02-14 12:56:28 -05:00
ConnorSkees
08bfa8f145
Implement one and two args for rgba()
2020-02-14 11:52:31 -05:00
ConnorSkees
a2ddc8016f
Implement builtin functions fade-in()
, fade-out()
, opacify()
, and transparentize()
2020-02-14 11:10:25 -05:00
ConnorSkees
38802b69c5
Fix hue algorithm when red == blue and red > green
2020-02-14 09:46:50 -05:00
ConnorSkees
201f97a914
Fix how hue is calculated when color channels are equal
2020-02-14 09:37:05 -05:00
ConnorSkees
be84350d19
Implement builtin functions saturate()
and desaturate()
2020-02-14 09:05:57 -05:00
ConnorSkees
c7c1ad5fe5
Implement builtin function darken()
2020-02-14 08:54:43 -05:00
ConnorSkees
db8e8eaebb
Implement builtin function lighten()
2020-02-14 08:43:10 -05:00
ConnorSkees
6427a7ab81
Implement builtin function adjust-hue
2020-02-14 08:15:19 -05:00
ConnorSkees
7fcfeee97e
clippy
2020-02-09 19:07:44 -05:00
ConnorSkees
f6b27177ba
Use Number as to represent color channels so precision is not lost
2020-02-09 18:53:48 -05:00
ConnorSkees
b8d8824db9
Lex and parse negative numbers
2020-02-09 15:08:33 -05:00
ConnorSkees
bc0c1d35f6
Clamp values passed to from_hsla()
2020-02-09 14:24:27 -05:00
ConnorSkees
d14ac11396
Implement weight
for invert()
2020-02-09 13:44:27 -05:00
ConnorSkees
1269c9f662
Initial implementation of invert()
(no support for weight
argument)
2020-02-09 13:31:58 -05:00
ConnorSkees
8638e2f251
Implement builtin functions hue()
, saturation()
, and lightness()
2020-02-09 12:18:41 -05:00
ConnorSkees
e282220f8c
Refactor how color repr is created
2020-02-09 10:56:45 -05:00
ConnorSkees
901c911b5b
Handle percentages and large/small values inside rgb()
and rgba()
2020-02-09 10:41:05 -05:00
ConnorSkees
3d0d37bf2d
Convert colors resulting from functions to named colors when applicable
2020-02-09 03:43:46 -05:00
ConnorSkees
5cab99cd6e
Implement hsl()
and hsla()
functions
2020-02-09 03:13:31 -05:00