matrix(a, b, c, d, e, f) = [a b c d e f]
translate(tx, ty=0) = [1 0 0 1 tx ty]
scale(sx, sy=sx) = [sx 0 0 sy 0 0]
rotate(α) = [cos(α) sin(α) -sin(α) cos(α) 0 0]
rotate(α, cx=0, cy=0) = [1 0 0 1 cx cy] [cos(α) sin(α) -sin(α) cos(α) 0 0] [1 0 0 1 -cx -cy]
skewX(α) = [1 0 tan(α) 1 0 0]
skewY(α) = [1 tan(α) 0 1 0 0]
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
// intended to be run with Node.js: `node palette.js > palette-conversion.txt` | |
const filename = 'emojione.sprites.png'; | |
const colors = require('./palette.json'); // an array of objects, where each object has 3 numeric values "r", "g" and "b" | |
var neuquant = require('neuquant'); // https://github.com/devongovett/neuquant | |
var PNG = require('png-js'); // https://github.com/devongovett/png.js | |
PNG.decode(filename, function(pixels) { | |
// pixels is a 1D array (in RGBA order) of decoded pixel data | |
var pal = neuquant.getPalette(pixels, 1); | |
var ipal = []; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
let content_security_policy = "script-src 'self'; object-src 'self' https://www.facebook.com/"; // for running in Chrome's JS console | |
/* Let’s see which Unicode 10.0 emojis Facebook already supports. | |
<https://github.com/Crissov/unicode-proposals/issues/254#issuecomment-284831620> */ | |
let myEmojis = new Map([ | |
['1f6f7', 'U+1F6F7 🛷 SLED'], | |
['1f6f8', 'U+1F6F8 🛸 FLYING SAUCER'], | |
['1f91f', 'U+1F91F 🤟 I LOVE YOU HAND SIGN'], | |
['1f928', 'U+1F928 🤨 FACE WITH ONE EYEBROW RAISED'], | |
['1f929', 'U+1F929 🤩 GRINNING FACE WITH STAR EYES'], | |
['1f92a', 'U+1F92A 🤪 GRINNING FACE WITH CRAZY EYES'], |
UTR#51 actually uses Unicode CLDR region codes for legal/required pairs of Regional Indicator Symbol Letters U+1F1E6–FF, but they are virtually identical to current ISO 3166-1 alpha-2 code elements. Some codes, however, had once been part of ISO 3166 but have since been deleted (and either exceptionally or transitionally reserved) or are indeterminately reserved for compatibility with other international standards. Some exceptional reservations are part of CLDR. Most transitional reservations now have ISO 3166-3 alpha-4 codes, which Unicode does not intend to support. Indeterminate reservations have been very rarely assigned to new countries and this probably won’t happen again.
Anyhow, many of the currently re