First commit

This commit is contained in:
Violet Millie 2024-02-04 00:01:06 +00:00
commit 9e261da70c
22 changed files with 369 additions and 0 deletions

163
.gitignore vendored Normal file
View File

@ -0,0 +1,163 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
out/

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/violet-emojis.iml" filepath="$PROJECT_DIR$/.idea/violet-emojis.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

10
.idea/violet-emojis.iml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/out" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# violet-emojis
Recoloured emojis to fit Violet Millie's preferred palette.

51
src/build.py Executable file
View File

@ -0,0 +1,51 @@
#!/bin/python
import json
import os
import shutil
import subprocess
# Configuration
emoji_data_json = "src/emoji-data.json"
out_dir = "out"
# TODO: Support multiple paths
emoji_source_dir = "src/twemoji"
with open(emoji_data_json, "r") as f:
emoji_data = json.load(f)
def get_emoji_data(emoji_id: str):
for emoji_entry in emoji_data["emojiData"]:
if emoji_id == emoji_entry["emojiId"]:
return emoji_entry
def build():
# lazy "clear contents" by re-creating
if os.path.isdir(out_dir):
shutil.rmtree(out_dir, ignore_errors=True)
os.mkdir(out_dir)
contents = os.listdir(emoji_source_dir)
for content in contents:
file_name = content.split(".")[0]
current_emoji_data = get_emoji_data(file_name)
build_name: str
if current_emoji_data is None:
# Convert to SVG and keep default name
print("uh oh")
build_name = file_name
pass
else:
build_name = current_emoji_data["buildName"]
subprocess.run(["rsvg-convert", os.path.join(emoji_source_dir, content), "--output", "%s/%s.png" % (out_dir, build_name)])
build()

53
src/emoji-data.json Normal file
View File

@ -0,0 +1,53 @@
{
"emojiData": [
{
"emojiId": "2b50",
"buildName": "v_star"
},
{
"emojiId": "1f495",
"buildName": "v_two_hearts"
},
{
"emojiId": "2728",
"buildName": "v_sparkles"
},
{
"emojiId": "1f494",
"buildName": "v_broken_heart"
},
{
"emojiId": "2763",
"buildName": "v_heart_exclamation"
},
{
"emojiId": "2764",
"buildName": "v_heart"
},
{
"emojiId": "1f4ab",
"buildName": "v_dizzy"
},
{
"emojiId": "2757",
"buildName": "v_exclamation_mark"
},
{
"emojiId": "2753",
"buildName": "v_question_mark"
},
{
"emojiId": "1f496",
"buildName": "v_sparkling_heart"
},
{
"emojiId": "1f49e",
"buildName": "v_two_hearts"
},
{
"emojiId": "1f49d",
"buildName": "v_gift_heart"
}
]
}

7
src/twemoji/1f494.svg Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<g fill="#e4d6f5">
<path d="M13.589 26.521c-.297-.495-.284-1.117.035-1.599l4.395-6.646-5.995-5.139c-.556-.476-.686-1.283-.31-1.911l4.304-7.172c-1.669-1.301-3.755-2.09-6.035-2.09-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c.025-.009.052-.022.077-.032l-4.488-7.481z"/>
<path d="M26.018 1.966c-2.765 0-5.248 1.151-7.037 2.983l-4.042 6.737 6.039 5.176c.574.492.691 1.335.274 1.966l-4.604 6.962 4.161 6.935c6.338-3.529 13.621-11.263 14.809-18.649.17-.721.268-1.469.268-2.241-.001-5.452-4.419-9.869-9.868-9.869z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 691 B

4
src/twemoji/1f495.svg Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M24.77 19.715c0-3.757-3.045-6.801-6.801-6.801-2.28 0-4.292 1.125-5.526 2.845-1.234-1.72-3.247-2.845-5.526-2.845-3.756 0-6.801 3.044-6.801 6.801 0 .531.067 1.049.183 1.545.945 5.867 7.468 12.059 12.144 13.758 4.675-1.699 11.2-7.891 12.142-13.756.117-.498.185-1.016.185-1.547zM35.885 5.693c0-2.602-2.109-4.711-4.711-4.711-1.579 0-2.973.78-3.828 1.972-.855-1.191-2.249-1.972-3.827-1.972-2.602 0-4.711 2.109-4.711 4.711 0 .369.047.727.127 1.07.654 4.064 5.173 8.353 8.411 9.529 3.238-1.177 7.758-5.465 8.412-9.528.08-.344.127-.702.127-1.071z" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 687 B

5
src/twemoji/1f496.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M35.885 11.833c0-5.45-4.418-9.868-9.867-9.868-3.308 0-6.227 1.633-8.018 4.129-1.791-2.496-4.71-4.129-8.017-4.129-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c6.783-2.466 16.249-11.447 17.617-19.959.17-.721.268-1.469.268-2.242z" fill="#e4d6f5"/>
<path d="M34.347 23.894l-3.824-1.416-1.416-3.824c-.145-.394-.52-.654-.938-.654-.418 0-.793.26-.938.653l-1.416 3.824-3.824 1.416c-.393.144-.653.519-.653.938 0 .418.261.793.653.938l3.824 1.416 1.416 3.824c.145.393.52.653.938.653.418 0 .793-.261.938-.653l1.416-3.824 3.824-1.416c.392-.145.653-.52.653-.938 0-.418-.261-.793-.653-.937zm-23-16.001l-2.365-.875-.875-2.365C7.961 4.26 7.587 4 7.169 4c-.419 0-.793.26-.938.653l-.876 2.365-2.364.875c-.393.146-.653.52-.653.938 0 .418.26.792.653.938l2.365.875.875 2.365c.146.393.52.653.938.653.418 0 .792-.26.938-.653l.875-2.365 2.365-.875c.393-.146.653-.519.653-.938 0-.418-.26-.792-.653-.938z" fill="#FDCB58"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

8
src/twemoji/1f49d.svg Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M35.885 11.833c0-5.45-4.418-9.868-9.867-9.868-3.308 0-6.227 1.633-8.018 4.129-1.791-2.496-4.71-4.129-8.017-4.129-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c6.783-2.466 16.249-11.447 17.617-19.959.17-.721.268-1.469.268-2.242z" fill="#e4d6f5"/>
<path d="M36 15c-1 5-4 8-4 8H4s-3-3-4-8h36z" fill="#FDD888"/>
<path d="M14 18v18l-5-5-5 5V18z" fill="#FDD888"/>
<path d="M16.802 9.194l-7.879 5.515-7.878-5.515C.47 8.792 0 9.036 0 9.738v14.658c0 .703.48.965 1.069.582l7.854-5.106 7.854 5.106c.588.383 1.069.121 1.069-.582V9.738c.001-.702-.47-.946-1.044-.544z" fill="#FDCB58"/>
<circle cx="9" cy="17" r="4" fill="#FDD888"/>
</svg>

After

Width:  |  Height:  |  Size: 801 B

5
src/twemoji/1f49e.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M35.977 16.672c-.25 4.574-8.194 8.248-17.977 8.248-3.285 0-6.352-.422-9-1.145v3.588c2.65 1.023 5.718 1.619 9 1.619 9.941 0 18-5.373 18-12 0-.104-.02-.207-.023-.31zM27 6.6c-2.646-1.024-5.717-1.617-9-1.617-9.018 0-16.465 4.426-17.774 10.194C1.535 11.106 8.982 7.982 18 7.982c3.283 0 6.354.418 9 1.142V6.6z" fill="#e4d6f5"/>
<path d="M24.77 19.715c0-3.757-3.045-6.801-6.801-6.801-2.28 0-4.292 1.125-5.526 2.845-1.234-1.72-3.247-2.845-5.526-2.845-3.756 0-6.801 3.044-6.801 6.801 0 .531.067 1.049.183 1.545.945 5.867 7.468 12.059 12.144 13.758 4.675-1.699 11.2-7.891 12.142-13.756.117-.498.185-1.016.185-1.547zM35.885 5.693c0-2.602-2.109-4.711-4.711-4.711-1.579 0-2.973.78-3.828 1.972-.855-1.191-2.249-1.972-3.827-1.972-2.602 0-4.711 2.109-4.711 4.711 0 .369.047.727.127 1.07.654 4.064 5.173 8.353 8.411 9.529 3.238-1.177 7.758-5.465 8.412-9.528.08-.344.127-.702.127-1.071z" fill="#ae8fd4"/>
</svg>

After

Width:  |  Height:  |  Size: 1019 B

5
src/twemoji/1f4ab.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M28.865 7.134c7.361 7.359 9.35 17.304 4.443 22.209-4.907 4.907-14.85 2.918-22.21-4.441-.25-.25-.478-.51-.716-.766l4.417-4.417c5.724 5.724 13.016 7.714 16.286 4.442 3.271-3.271 1.282-10.563-4.441-16.287l.022.021-.021-.022C20.104 1.331 11.154-.326 6.657 4.171 4.482 6.346 3.76 9.564 4.319 13.044c-.858-4.083-.15-7.866 2.338-10.353 4.906-4.906 14.849-2.917 22.208 4.443z" fill="#e4d6f5"/>
<path d="M19.403 34c-.252 0-.503-.077-.719-.231l-5.076-3.641-5.076 3.641c-.433.31-1.013.31-1.443-.005-.43-.312-.611-.864-.45-1.369l1.894-6.11-5.031-3.545c-.428-.315-.605-.869-.442-1.375.165-.504.634-.847 1.165-.851l6.147-.012 2.067-5.957c.168-.504.639-.844 1.17-.844.531 0 1.002.34 1.17.844l1.866 5.957 6.347.012c.532.004 1.002.347 1.165.851.164.506-.014 1.06-.442 1.375l-5.031 3.545 1.893 6.11c.162.505-.021 1.058-.449 1.369-.217.158-.471.236-.725.236z" fill="#ae8fd4"/>
</svg>

After

Width:  |  Height:  |  Size: 990 B

5
src/twemoji/2728.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M34.347 16.893l-8.899-3.294-3.323-10.891c-.128-.42-.517-.708-.956-.708-.439 0-.828.288-.956.708l-3.322 10.891-8.9 3.294c-.393.146-.653.519-.653.938 0 .418.26.793.653.938l8.895 3.293 3.324 11.223c.126.424.516.715.959.715.442 0 .833-.291.959-.716l3.324-11.223 8.896-3.293c.391-.144.652-.518.652-.937 0-.418-.261-.792-.653-.938z" fill="#ae8fd4"/>
<path d="M14.347 27.894l-2.314-.856-.9-3.3c-.118-.436-.513-.738-.964-.738-.451 0-.846.302-.965.737l-.9 3.3-2.313.856c-.393.145-.653.52-.653.938 0 .418.26.793.653.938l2.301.853.907 3.622c.112.444.511.756.97.756.459 0 .858-.312.97-.757l.907-3.622 2.301-.853c.393-.144.653-.519.653-.937 0-.418-.26-.793-.653-.937zM10.009 6.231l-2.364-.875-.876-2.365c-.145-.393-.519-.653-.938-.653-.418 0-.792.26-.938.653l-.875 2.365-2.365.875c-.393.146-.653.52-.653.938 0 .418.26.793.653.938l2.365.875.875 2.365c.146.393.52.653.938.653.418 0 .792-.26.938-.653l.875-2.365 2.365-.875c.393-.146.653-.52.653-.938 0-.418-.26-.792-.653-.938z" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

5
src/twemoji/2753.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M17 27c-1.657 0-3-1.343-3-3v-4c0-1.657 1.343-3 3-3 .603-.006 6-1 6-5 0-2-2-4-5-4-2.441 0-4 2-4 3 0 1.657-1.343 3-3 3s-3-1.343-3-3c0-4.878 4.58-9 10-9 8 0 11 5.982 11 11 0 4.145-2.277 7.313-6.413 8.92-.9.351-1.79.587-2.587.747V24c0 1.657-1.343 3-3 3z" fill="#e4d6f5"/>
<circle cx="17" cy="32" r="3" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 447 B

5
src/twemoji/2757.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<circle cx="18" cy="32" r="3" fill="#e4d6f5"/>
<path d="M21 24c0 1.657-1.344 3-3 3-1.657 0-3-1.343-3-3V5c0-1.657 1.343-3 3-3 1.656 0 3 1.343 3 3v19z" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 290 B

5
src/twemoji/2763.svg Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M18 4C14.875-2.375 6-.731 6 7c0 7.062 12 17 12 17s12-9.938 12-17c0-7.731-8.875-9.375-12-3z" fill="#e4d6f5"/>
<circle cx="18" cy="31" r="5" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 288 B

4
src/twemoji/2764.svg Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M35.885 11.833c0-5.45-4.418-9.868-9.867-9.868-3.308 0-6.227 1.633-8.018 4.129-1.791-2.496-4.71-4.129-8.017-4.129-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c6.783-2.466 16.249-11.447 17.617-19.959.17-.721.268-1.469.268-2.242z" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 425 B

4
src/twemoji/2b50.svg Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<path d="M27.287 34.627c-.404 0-.806-.124-1.152-.371L18 28.422l-8.135 5.834c-.693.496-1.623.496-2.312-.008-.689-.499-.979-1.385-.721-2.194l3.034-9.792-8.062-5.681c-.685-.505-.97-1.393-.708-2.203.264-.808 1.016-1.357 1.866-1.363L12.947 13l3.179-9.549c.268-.809 1.023-1.353 1.874-1.353.851 0 1.606.545 1.875 1.353L23 13l10.036.015c.853.006 1.606.556 1.867 1.363.263.81-.022 1.698-.708 2.203l-8.062 5.681 3.034 9.792c.26.809-.033 1.695-.72 2.194-.347.254-.753.379-1.16.379z" fill="#e4d6f5"/>
</svg>

After

Width:  |  Height:  |  Size: 611 B