Repository navigation
Feature: make exact evaluation of function-defined colormaps accessible #157
Copy link
Copy link
Open
Description
Activity
I agree, and I'm open to either solution. The public accessor is a little more explicit, but also a bit more "different" for the user wanting a color mapped at an arbitrary location. N=None is nice for the single entry point, but slightly more magic. I'm open to either. You have a preference?
Despite wanting to push the magic solution, I think just making the accessor public is the more responsible option. That wouldn't preclude adding the N=None approach later if there was a compelling reason/demand for it...
Sounds good to me, would you be able to make that PR?
- 100%. Also wondering (a) if you’d had time to look at #155 and (b) where you sit on the idea of having a fourth exceptional value representing masked voxels? Right now napari lumps masks into bad_color along with nan. I peeled that out of this PR based on @jni’s reticence, but I still think it could be supported via the same mechanism without adding much additional complexity.…On Oct 2, 2026, at 3:24 AM, Talley Lambert ***@***.***> wrote: tlambert03 left a comment (pyapp-kit/cmap#157) <#157 (comment)> Sounds good to me, would you be able to make that PR? — Reply to this email directly, view it on GitHub <#157?email_source=notifications&email_token=AAOPZ2YJDV7DQVHISRB2AVT5R5Q3XA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOJUHAYTEOBXHE2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5948128794>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAOPZ2YWF2B3XURXUNXFLF35R5Q3XAVCNFSNUABFKJSXA33TNF2G64TZHM2TQMZZHE4TAMZTHNEXG43VMU5TKNRVG44TGNRVG44KC5QC>. You are receiving this because you authored the thread.
- …On Oct 2, 2026, at 8:01 AM, Family Schabel ***@***.***> wrote: 100%. Also wondering (a) if you’d had time to look at #155 and (b) where you sit on the idea of having a fourth exceptional value representing masked voxels? Right now napari lumps masks into bad_color along with nan. I peeled that out of this PR based on @jni’s reticence, but I still think it could be supported via the same mechanism without adding much additional complexity. > On Oct 2, 2026, at 3:24 AM, Talley Lambert ***@***.***> wrote: > > > tlambert03 > left a comment > (pyapp-kit/cmap#157) > <#157 (comment)> > Sounds good to me, would you be able to make that PR? > > — > Reply to this email directly, view it on GitHub <#157?email_source=notifications&email_token=AAOPZ2YJDV7DQVHISRB2AVT5R5Q3XA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOJUHAYTEOBXHE2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5948128794>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAOPZ2YWF2B3XURXUNXFLF35R5Q3XAVCNFSNUABFKJSXA33TNF2G64TZHM2TQMZZHE4TAMZTHNEXG43VMU5TKNRVG44TGNRVG44KC5QC>. > You are receiving this because you authored the thread. >
commented there, i'm ok with it 👍
Reacted by Matthias Schabel
Metadata
Metadata
Assignees
Labels
No labels
Colormap.__call__always goes through a 256-entry LUT, so a colormap defined by a function (ColorStops(lut_func=...), e.g. prism, flag, gnuplot, cubehelix) cannot be evaluated exactly at an arbitrary position through the public API. The function itself is only reachable as the privateColorStops._lut_func, andcolor_stops.stopsholds a 256-point sampling of it.lut(n)already evaluates the function directly at anynbut there's no public entry point for arbitrary x. Either a public read-onlyColorStops.lut_funcproperty or anN=Noneoption onColormap.__call__that evaluateslut_funcwhen it exists would be nice...