forked from golang/exp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shiny/iconvg: add 3 byte color encodings.
There are two new encodings, direct and indirect. The indirect encoding, or at least some way to water down a custom palette color, is necessary for icons like https://raw.githubusercontent.com/google/material-design-icons/master/device/svg/production/ic_signal_wifi_2_bar_48px.svg which say `<path fill-opacity=".3" d="etc">`. Rendering such icons need a partially transparent version of a custom palette color, e.g. the theme foreground color, which could be black for a traditional theme or white for a dark theme. The direct encoding doesn't offer anything beyond the existing 4 byte encoding, other than being a shorter encoding. It could come up relatively often, though, if e.g. the suggested palette's elements are all fully opaque. Reserved styling opcodes aren't particularly scarce, so I think it's a win overall. I think we might as well add it now, if we're adding the 3 byte indirect encoding, and avoid re-basing the other opcodes again if we added it separately. Also fix some opcode typos in encode.go, with TODOs for more tests. Change-Id: I0dd004b8ccbeab77dbb6a954f650e7b470ef9af7 Reviewed-on: https://go-review.googlesource.com/29451 Reviewed-by: David Crawshaw <[email protected]>
- Loading branch information
Showing
3 changed files
with
53 additions
and
30 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
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
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