-
Notifications
You must be signed in to change notification settings - Fork 90
Description
IconFilterStrategy.THEMED_FOLLOW_COLOR_TOKENS is implemented with ContainerTokensFilter. The color mapping in here only looks at surface and outline tokens for brightness-based color filtering.
The main issue here is that these tokens do not cover the full range of brightness. Common examples include ranges like 108..206 or similar, while the full brightness range is 0..255. The end result is that a wide range of dark pixels in the original image get quantized into a much lighter color, usually the containerOutline for light tokens, and the final filtered image is washed out and looks disabled:
seen here for the bright red part of the scissors icon and the bright blue part of the shredder icon.
In order to filter the incoming image and retain the brightness information in it, color remapping should use an expanded brightness range. A few considerations, as this is not yet a fully formed proposal:
- Attach either the HCT seed or a full
BaseTonalPalettetoContainerColorTokensso that this information can be used to configure the color mapping. - Consider how this works for mutable
BladeContainerColorTokens. It might be simpler to attach a single HCT seed and interpolate that in variousBladeUtilsmethods, but that won't work for bimodal palettes driven by two HCT seeds. - Performance considerations - converting between RGB and HCT is additional overhead. This needs to collect numbers on how expensive it is, considering that the full tonal palette has 101 stops in the
0..100range. If it's too expensive to compute all of them, maybe it can be done in increments of 5 or similar. - Consider switching from brightness-based mapping to tone-based mapping. This needs to measure performance, as it will involve converting every incoming pixel to the HCT color space.
- A nice to have would be limiting the output range to a smaller range of brightness or tones. Instead of mapping incoming pure white to pure white, for example, the output tone range can be something like
10..90, leading to more interesting or "graded" visuals where the hue of the seed color is seen in every output pixel, both brights and darks.