melsonic
01e9a44fdf
change err check flow
2025-04-21 22:38:15 +05:30
melsonic
909eeb00af
update gradient color stop validity check
2025-04-18 21:22:07 +05:30
melsonic
4a6ab032e7
validate gradient color stops
2025-04-16 00:49:12 +05:30
melsonic
b7a0219680
moved gradient test location
2025-04-12 23:30:35 +05:30
melsonic
cc6d722e2e
refactored fn calls & names
2025-04-11 01:43:47 +05:30
melsonic
8f64c02dd8
fix: made gradients work in sketch mode
2025-04-08 20:33:10 +05:30
Alexander Wang
e6b1a72a63
next
2024-09-27 15:55:55 -06:00
Alexander Wang
09cf9ae7d1
d2render: support gradient values
2024-09-27 15:49:10 -06:00
Alexander Wang
a098ba80ec
validate
2023-12-14 11:35:49 -08:00
Eng Zer Jun
5c2d468058
lib/color: avoid unnecessary byte/string conversion
...
We can use `(*regexp.Regexp).MatchString` instead of
`(*regexp.Regexp).Match([]byte(...))` to avoid unnecessary `[]byte`
conversions and reduce allocations.
Example benchmark:
func BenchmarkMatch(b *testing.B) {
for i := 0; i < b.N; i++ {
if match := themeColorRegex.Match([]byte("N1")); !match {
b.Fail()
}
}
}
func BenchmarkMatchString(b *testing.B) {
for i := 0; i < b.N; i++ {
if match := themeColorRegex.MatchString("N1"); !match {
b.Fail()
}
}
}
goos: linux
goarch: amd64
pkg: oss.terrastruct.com/d2/lib/color
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16 9894165 114.3 ns/op 2 B/op 1 allocs/op
BenchmarkMatchString-16 13439838 83.61 ns/op 0 B/op 0 allocs/op
PASS
ok oss.terrastruct.com/d2/lib/color 3.306s
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-18 23:30:11 +08:00
Bernard Xie
2292ed4653
Update color.go
2023-02-27 16:46:44 -08:00
Bernard Xie
d72068d194
Update color.go
2023-02-27 16:45:25 -08:00
Bernard Xie
3427ea1717
w3 official source
2023-02-27 16:38:48 -08:00
Bernard Xie
2fb0df3563
add rebecca purple
2023-02-27 16:34:44 -08:00
Bernard Xie
8e0feef0da
color comment
2023-02-27 16:30:25 -08:00
Bernard Xie
7c295c1942
to lower on name2rgb
2023-02-27 16:27:28 -08:00
Bernard Xie
b48c2b411f
Update color.go
2023-02-27 16:22:10 -08:00
Bernard Xie
63ffcba215
error
2023-02-27 16:10:00 -08:00
Bernard Xie
66083e2d98
set root fill as transparent on pdf exports
2023-02-27 16:05:41 -08:00
Bernard Xie
29e76b77b8
Merge branch 'master' into support-diagram-fill-pdf
2023-02-27 14:11:07 -08:00
Bernard Xie
fb4eb36214
Add support
2023-02-27 14:10:59 -08:00
Alexander Wang
9cdfd20ff9
changelog
2023-02-27 12:58:21 -08:00
Alexander Wang
e5eacbd499
fix theme regex
2023-02-27 12:56:04 -08:00
Alexander Wang
0fe1c6d0cf
fix color codes
2023-02-23 17:15:29 -08:00
Vojtěch Fošnár
732f5c241f
bgColor and fgColor are now just constants
2023-02-19 15:54:17 +01:00
Vojtěch Fošnár
01928a5032
review fixes
2023-01-30 12:06:54 +01:00
Vojtěch Fošnár
19c53d5185
added missing colors conversion
2023-01-12 11:19:34 +01:00
Vojtěch Fošnár
63a0c1e2b1
vary sketch overlay color depending on the background and small refactoring
2023-01-11 22:18:14 +01:00
Vojtěch Fošnár
84e8c25e37
implemented (limited) darkening of theme colors and fixed rendering of the 3D box
2023-01-09 22:50:17 +01:00
Vojtěch Fošnár
a81ab2d73e
support for prefers-color-scheme
2023-01-09 19:16:28 +01:00
Gavin Nishizawa
8cc5e733f9
render 3d keyword
2022-11-10 11:36:32 -08:00