Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts and experience preferred (super rare at this point).
This file contains hidden or 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 elisp code uses use-package, a macro to simplify configuration. It will | |
| ;; install it if it's not available, so please edit the following code as | |
| ;; appropriate before running it. | |
| ;; Note that this file does not define any auto-expanding YaSnippets. | |
| ;; Install use-package | |
| (package-install 'use-package) | |
| ;; AucTeX settings - almost no changes |
This file contains hidden or 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
| // color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255 | |
| uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) { | |
| uint64_t c1 = (uint64_t) color1; | |
| uint64_t c2 = (uint64_t) color2; | |
| uint64_t a = (uint64_t)( alpha >> 4 ); | |
| // bit magic to alpha blend R G B with single mul | |
| c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f; | |
| c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f; | |
| uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f; |