Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for !rgb command compression #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Someoneamzing
Copy link

@Someoneamzing Someoneamzing commented Sep 2, 2020

Added support to read compressed !rgb commands where the colours can be either a raw colour or an index of an existing colour.
i.e. if the first colour is red then the second green then the third red
!rgb ff0000,00ff00,ff0000
rather than repeat the red colour again we can use a back-reference.
!rgb ff0000,00ff00,*0 meaning the third colour is the same as the first.

The * denotes a back reference.

Two upsides is that this still supports the old format for anyone who wants to write the raw command. And the compressed format will never be larger than the original even if no colour is repeated as it will just be the same as if we had not compressed it.

The mirrored pull-request on react-pixel-art-maker can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant