Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(color): improve int ARGB/ABGR support
- add CSS conversions - add ARGB<>ABGR swapping - add converters for RGB/SRGB
- Loading branch information
1 parent
6b5dd8e
commit 6460e4d
Showing
6 changed files
with
29 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Convert ARGB int to ABGR and vice versa. | ||
* | ||
* @param x | ||
*/ | ||
export const intArgb32Abgr32 = (x: number) => | ||
((x & 0xff) << 16) | ((x >> 16) & 0xff) | (x & 0xff00ff00); | ||
|
||
/** | ||
* Same as {@link intArgbAbgr}. | ||
*/ | ||
export const intAbgr32Argb32 = intArgb32Abgr32; |
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