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

support palette-based color #230

Closed
dankamongmen opened this issue Dec 27, 2019 · 2 comments
Closed

support palette-based color #230

dankamongmen opened this issue Dec 27, 2019 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

It might be desirable to support an 8-bit notcurses-wide palette. This would allow for very fast palette fades and sprite tricks. We could hijack the 16 free bits from the attrword for a fore- and background palette, and 2 of 8 free bits from the channels. Then again, maybe we don't want to blow 75% of our free cell space on this idea.

If we do it, we alloc up 2x256x3 (~1.5KB) for the notcurses struct. the "default color" bits still take ultimate precedence. after that, we use the palette bits if the palette indicator bit is high, and the rgb bits otherwise. setting the rgb bits clears the palette indicator bit. setting the palette bits sets the PIB.

@dankamongmen dankamongmen self-assigned this Dec 27, 2019
@dankamongmen dankamongmen added duplicate This issue or pull request already exists enhancement New feature or request labels Dec 27, 2019
@dankamongmen
Copy link
Owner Author

(if it isn't obvious, the "massive speedup" would come from being able to change colors via o(1) palette swap rather than o(N) walks of the planes, changing their colors).

@dankamongmen dankamongmen removed the duplicate This issue or pull request already exists label Dec 27, 2019
@dankamongmen dankamongmen added this to the v1.1.0 milestone Jan 14, 2020
dankamongmen added a commit that referenced this issue Jan 15, 2020
dankamongmen added a commit that referenced this issue Jan 15, 2020
dankamongmen added a commit that referenced this issue Jan 15, 2020
@dankamongmen
Copy link
Owner Author

I've added bit definitions and some basic cell_ functionality. I've added the full palette256 functionality. I've updated rasterization to emit the necessary initc commands using an update map. I've updated the various docs and added unit tests.

rendering needs be updated to use this, and then we need a demo (#253).

dankamongmen added a commit that referenced this issue Jan 15, 2020
dankamongmen added a commit that referenced this issue Jan 15, 2020
dankamongmen added a commit that referenced this issue Jan 15, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 17, 2020
@dankamongmen dankamongmen added the documentation Improvements or additions to documentation label Jan 17, 2020
dankamongmen added a commit that referenced this issue Jan 19, 2020
dankamongmen added a commit that referenced this issue Jan 19, 2020
* palette_set: update pal256 damage map #230
* drone: use newest builders
* palette: send oc on exit for color reset #285
* palette_new: copy existing palette in #230
* Python: use checkRGB everywhere
* more palette unit testing
* add ncplane_set_*_palindex()
* render fg palindex #230
* palette index color is out of 1000
* jungle demo works #253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant