Proposal: New Bone Color Presets #112635

Closed
opened 2023-09-20 19:07:07 +02:00 by Demeter Dzadik · 25 comments
Member

Comparisons

Edge Shapes Deselected Edge Shapes Selected Polygon Shapes Deselected Polygon Shapes Selected Theme UI
Old Edge Before Desel Edge Before Sel Poly Before DeSel Poly Before Sel Before Theme UI
New v2 Edge v2 DeSel Edge v2 Sel Poly v2 DeSel Poly v2 Sel v2 Theme UI
New v3 Edge v3 DeSel Edge v3 Sel Poly v3 DeSel Poly v3 Sel v3 Theme UI

Test it out!

You can simply download and open this file to test out the proposed presets.

Intro

Most rigs are forced to use Custom Colors very often, because not enough of the preset colors feel nice to use. This is a shame, because Custom Colors cannot be customized on a user-level, via the theme settings. I think if the Preset Colors were better, Custom Colors wouldn't even be necessary; The 20 slots that we have are plenty enough to cover the entire color wheel with distinct enough colors. At that point, even if you wanted to add a custom color, you'd be hard pressed to find a color that isn't very similar to one of the presets.

Issues with current bone color presets:

  • Slots 16-20 are blank, immediately not useful.
  • Most colors are too dark, and do not contrast well against Blender's default viewport background color, which is a dark gray in the case of all shipped themes.

The colors in this proposal:

  • Base colors are much brighter.
  • Base colors were eyeballed to feel equally bright, and equally contrasting against the default viewport background color.
  • Selected color was calculated as a luma offset using fancy maths, then manually adjusted here and there to again, feel like they all have the same brightness.
  • Active color was done in a really dumb way by just setting the saturation to 0.1. I think this works really well tbh. If it's stupid and it works, it ain't stupid!
  • Colors are spread out fairly evenly across the color wheel, while giving maximum effort to make neighbouring colors as distinct as possible.
  • Themes tend to deviate very little in their 3D view background color, and if they do, they are darker, which is even better. For that reason, these colors work fine for all themes.
  • Presets have been sorted by hue. This may make old rigs that used presets look quite different than they used to. This was agreed upon without objections at this module meeting, since not many rigs today use the existing presets anyways, as mentioned in the intro. The benefit of sorting them by hue is that users don't get caught off guard when assigning 2 presets far from each other in the list, only to find that they are not that distinct from each other.

Base PR
Add-ons repo PR

## Comparisons | | Edge Shapes Deselected | Edge Shapes Selected | Polygon Shapes Deselected| Polygon Shapes Selected | Theme UI | |---|---|---|---|---|---| | Old | ![Edge Before Desel](/attachments/a5c9f64c-53c8-4729-8be5-e7d101e6e25b) | ![Edge Before Sel](/attachments/7647aaac-7c2a-44d2-8b3d-d6ab3e419e48) | ![Poly Before DeSel](/attachments/4446155a-8f5d-4f3b-a02b-747aee8db767) | ![Poly Before Sel](/attachments/81b1eef8-bdb9-4204-b60f-1c4cbfabcc92) | ![Before Theme UI](/attachments/4ece910f-dd28-4b9d-942c-b88cdd7a3da1) | | New v2 | ![Edge v2 DeSel](/attachments/de6cabf0-1033-4009-9f17-d2f7509d4eff) | ![Edge v2 Sel](/attachments/8126ce29-3ede-4573-a656-016d6cedaa1b) | ![Poly v2 DeSel](/attachments/9e8c35ae-7890-4e3c-a903-5ba8987e83a1) | ![Poly v2 Sel](/attachments/e0498423-c9c7-4c4b-bba2-288b6e91822c) | ![v2 Theme UI](/attachments/8e015856-fb2c-4117-b8a7-cf9a80b04387) | | New v3 | ![Edge v3 DeSel](/attachments/ffa5f31c-2927-498b-bf6e-fb32f6e9877a) | ![Edge v3 Sel](/attachments/f3b62403-c1c1-48d0-abcb-e030a922f378) | ![Poly v3 DeSel](/attachments/b0af795b-d284-4f7f-838a-fa2a8a736e4a) | ![Poly v3 Sel](/attachments/3332d8bc-4960-4bc8-88d1-834b6c9ccfbb) | ![v3 Theme UI](/attachments/68d3cb43-5429-4d43-869f-3ae07b891976) | ## Test it out! You can simply download and open [this file](/attachments/f4be24e7-4067-4c79-a209-3aba28a4752e) to test out the proposed presets. ### Intro Most rigs are forced to use Custom Colors very often, because not enough of the preset colors feel nice to use. This is a shame, because Custom Colors cannot be customized on a user-level, via the theme settings. I think if the Preset Colors were better, Custom Colors wouldn't even be necessary; The 20 slots that we have are plenty enough to cover the entire color wheel with distinct enough colors. At that point, even if you wanted to add a custom color, you'd be hard pressed to find a color that isn't very similar to one of the presets. ### Issues with current bone color presets: - Slots 16-20 are blank, immediately not useful. - Most colors are too dark, and do not contrast well against Blender's default viewport background color, which is a dark gray in the case of all shipped themes. ### The colors in this proposal: - Base colors are much brighter. - Base colors were eyeballed to feel equally bright, and equally contrasting against the default viewport background color. - Selected color was calculated as a luma offset using fancy maths, then manually adjusted here and there to again, feel like they all have the same brightness. - Active color was done in a really dumb way by just setting the saturation to 0.1. I think this works really well tbh. If it's stupid and it works, it ain't stupid! - Colors are spread out fairly evenly across the color wheel, while giving maximum effort to make neighbouring colors as distinct as possible. - Themes tend to deviate very little in their 3D view background color, and if they do, they are darker, which is even better. For that reason, these colors work fine for all themes. - Presets have been sorted by hue. This may make old rigs that used presets look quite different than they used to. This was agreed upon without objections at [this module meeting](https://devtalk.blender.org/t/2023-10-05-animation-rigging-module-meeting/31420), since not many rigs today use the existing presets anyways, as mentioned in the intro. The benefit of sorting them by hue is that users don't get caught off guard when assigning 2 presets far from each other in the list, only to find that they are not that distinct from each other. [Base PR](https://projects.blender.org/blender/blender/pulls/112639) [Add-ons repo PR](https://projects.blender.org/blender/blender-addons/pulls/104905)
Demeter Dzadik added the
Type
Design
label 2023-09-20 19:07:07 +02:00
Demeter Dzadik added this to the Animation & Rigging project 2023-09-20 19:07:13 +02:00
Demeter Dzadik added the
Interest
Animation & Rigging
label 2023-09-20 19:07:23 +02:00
Member

This definitely looks better! We also recently discussed the visual confusion of custom bone colors at a recent module meeting:
https://devtalk.blender.org/t/2023-08-31-animation-rigging-module-meeting/30914#patch-review-decision-time-5 (see the second top-level bullet under the linked section)

Ivan proposed only customizing the unselected color, while leaving the selected and active colors as default, to make those states always unambiguous. We agreed at the meeting that this is probably a good idea, and Ivan is working on a fuller proposal.

There was also some discussion about solid-shaded rig controls, which apparently introduce their own confusion.

Regardless, I think your work here is still relevant, because even the unselected colors were a mess, and this is a big improvement.

Something else I think we should explore is optimizing the order of the color presets, to put the most mutually-distinct presets first. For example, right now the first two presets are red and orange, which isn't optimal. Whereas if we order them for distinctness, then users can relatively mindlessly just start at the beginning of the list, and regardless of how many presets they use they can be confident they have the most distinct presets at that count.

This definitely looks better! We also recently discussed the visual confusion of custom bone colors at a recent module meeting: https://devtalk.blender.org/t/2023-08-31-animation-rigging-module-meeting/30914#patch-review-decision-time-5 (see the second top-level bullet under the linked section) Ivan proposed only customizing the *unselected* color, while leaving the selected and active colors as default, to make those states always unambiguous. We agreed at the meeting that this is probably a good idea, and Ivan is working on a fuller proposal. There was also some discussion about solid-shaded rig controls, which apparently introduce their own confusion. Regardless, I think your work here is still relevant, because even the unselected colors were a mess, and this is a big improvement. Something else I think we should explore is optimizing the *order* of the color presets, to put the most mutually-distinct presets first. For example, right now the first two presets are red and orange, which isn't optimal. Whereas if we order them for distinctness, then users can relatively mindlessly just start at the beginning of the list, and regardless of how many presets they use they can be confident they have the most distinct presets at that count.

With regards to the proposal of @icappiello, it's clear from @Mets 's proposal:

Theme UI screenshot

that the relationship between "regular" and "selected"/"active" can differ quite wildly. Especially when the "regular" colour is very dark (which can be super useful for certain "don't touch these" bones), they should still stand out while selected. This seems to suggest that the "selected" and "active" brightnesses should be somewhat fixed values, while the hue & saturation can change. I'm curious what you come up with, Ivan!

With regards to the proposal of @icappiello, it's clear from @Mets 's proposal: ![Theme UI screenshot](https://projects.blender.org/attachments/826548d0-8f47-44fc-be9b-0f5c8c3acd34) that the relationship between "regular" and "selected"/"active" can differ quite wildly. Especially when the "regular" colour is very dark (which can be super useful for certain "don't touch these" bones), they should still stand out while selected. This seems to suggest that the "selected" and "active" brightnesses should be somewhat fixed values, while the hue & saturation can change. I'm curious what you come up with, Ivan!
Member

@dr.sybren, @Mets proposal lgtm. To be clear i am working on a different thing as long as i can see.
I were suggesting to change the actual behavuour of active/selected by unifying those in the preferences instead of having to explicitly choose one for each theme.
The customization of selected/active per theme should instead be explicitly enabled by the user in the bone groups ui panel.
Menaning reversing what rigify bone groups do right now (setting an unified color for active/selected picking it from blender general ui theme setting)

@dr.sybren, @Mets proposal lgtm. To be clear i am working on a different thing as long as i can see. I were suggesting to change the actual behavuour of active/selected by unifying those in the preferences instead of having to explicitly choose one for each theme. The customization of selected/active per theme should instead be explicitly enabled by the user in the bone groups ui panel. Menaning reversing what rigify bone groups do right now (setting an unified color for active/selected picking it from blender general ui theme setting)
Author
Member

While unifying selected/active colors across all presets would make things a lot easier, I actually don't like it. I think it's because I'm lazy and my rigs' bone shapes are not very distinct, so I rely on colors more to visually categorize bones. Therefore, if those colors disappear when many bones are selected, I'm not happy.
But to have an option for that makes perfect sense, and I don't even mind if it's on by default. I would just turn it off for myself, I won't cry about it.

optimizing the order of the color presets, to put the most mutually-distinct presets first

This has the downside where you might apply preset 03 and 12 to some bones because they look pretty distinct in this list of colors where the hue is jumping all over the place, but when put next to each other, they are actually quite similar, so you might end up assigning similar colors to two sets of bones unintentionally. So, if we were to sort, I would actually sort by hue.

But the issue with any kind of sorting is that any old rigs that used the presets would look completely different then. With the current proposal, they would only look... a lot brighter. :D

Still, I do think if we're willing to piss off a few people, hue sorting would be better UX long-term.

While unifying selected/active colors across all presets would make things a lot easier, I actually don't like it. I think it's because I'm lazy and my rigs' bone shapes are not very distinct, so I rely on colors more to visually categorize bones. Therefore, if those colors disappear when many bones are selected, I'm not happy. But to have an option for that makes perfect sense, and I don't even mind if it's on by default. I would just turn it off for myself, I won't cry about it. > optimizing the order of the color presets, to put the most mutually-distinct presets first This has the downside where you might apply preset 03 and 12 to some bones because they look pretty distinct in this list of colors where the hue is jumping all over the place, but when put next to each other, they are actually quite similar, so you might end up assigning similar colors to two sets of bones unintentionally. So, if we were to sort, I would actually sort by hue. But the issue with any kind of sorting is that any old rigs that used the presets would look completely different then. With the current proposal, they would only look... a lot brighter. :D Still, I do think if we're willing to piss off a few people, hue sorting would be better UX long-term.

Regarding the use of brightness for selection: is it possible to ensure the colors have exactly the same visual brightness? And not in just the max channel values, but what you actually see on the screen, i.e. compensate for any effects where certain colors appear brighter than the others.

Regarding the use of brightness for selection: is it possible to ensure the colors have exactly the same visual brightness? And not in just the max channel values, but what you actually see on the screen, i.e. compensate for any effects where certain colors appear brighter than the others.
Member

Regarding the use of brightness for selection: is it possible to ensure the colors have exactly the same visual brightness? And not in just the max channel values, but what you actually see on the screen, i.e. compensate for any effects where certain colors appear brighter than the others.

this would be a nice improvement, but do you already know how to do it?

> Regarding the use of brightness for selection: is it possible to ensure the colors have exactly the same visual brightness? And not in just the max channel values, but what you actually see on the screen, i.e. compensate for any effects where certain colors appear brighter than the others. this would be a nice improvement, but do you already know how to do it?

this would be a nice improvement, but do you already know how to do it?

Well, I expect you need to adjust the color to target a specific luminance without affecting hue, and minimally affecting saturation (unlike value, increasing luminance past a certain point requires desaturation, e.g. luminance 1 is only achievable with pure white). The questions would be:

  • Where to get the target luminance (use the 'default' selected and active colors maybe?)
  • What specifically to do with saturation if decreasing luminance - should it increase saturation in any circumstances, or preserve existing?
> this would be a nice improvement, but do you already know how to do it? Well, I expect you need to adjust the color to target a specific luminance without affecting hue, and minimally affecting saturation (unlike value, increasing luminance past a certain point requires desaturation, e.g. luminance 1 is only achievable with pure white). The questions would be: * Where to get the target luminance (use the 'default' selected and active colors maybe?) * What specifically to do with saturation if decreasing luminance - should it increase saturation in any circumstances, or preserve existing?
Author
Member

I don't think reducing saturation for the selected/active colors is a problem. Maybe using a luminance offset for selection states would work, but do note that in order to find 20 unique enough base colors, some of those base colors might be desaturated in the first place, or even be black and white.

In any case, there's a handy .blend file attached in the post where you can try to experiment with stuff by looping over the theme preset colors and applying some maths based on to the base color of each preset. I'm not sure if there are native functions for setting luminance, but maybe. There's also the PR, which if you apply and then reload factory settings, you'll get the colors that I came up with, if you want to use that as a starting poing.

I don't think reducing saturation for the selected/active colors is a problem. Maybe using a luminance offset for selection states would work, but do note that in order to find 20 unique enough base colors, some of those base colors might be desaturated in the first place, or even be black and white. In any case, there's a handy .blend file attached in the post where you can try to experiment with stuff by looping over the theme preset colors and applying some maths based on to the base color of each preset. I'm not sure if there are native functions for setting luminance, but maybe. There's also the PR, which if you apply and then reload factory settings, you'll get the colors that I came up with, if you want to use that as a starting poing.

In any case, there's a handy .blend file attached in the post where you can try to experiment with stuff by looping over the theme preset colors and applying some maths based on to the base color of each preset.

Well, here is a file where I added luminance unification to your script, using the default selected and active colors as the reference. It basically scales the color until any component reaches 1, and then mixes in white (desaturates) if that was not enough to reach the goal.

P.S. I also noticed that when the bones are drawn, 50 is subtracted from the Normal color, so the color in the settings does not reflect the actual appearance...

> In any case, there's a handy .blend file attached in the post where you can try to experiment with stuff by looping over the theme preset colors and applying some maths based on to the base color of each preset. Well, here is a file where I added luminance unification to your script, using the default selected and active colors as the reference. It basically scales the color until any component reaches 1, and then mixes in white (desaturates) if that was not enough to reach the goal. P.S. I also noticed that when the bones are drawn, 50 is subtracted from the Normal color, so the color in the settings does not reflect the actual appearance...

Well, here is a file where I added luminance unification to your script, using the default selected and active colors as the reference. It basically scales the color until any component reaches 1, and then mixes in white (desaturates) if that was not enough to reach the goal.

With so much color science going on, I feel that this is not something that should be addressed/implemented for bone colors alone. If we want to have some calculation of the preceived brighness of a color, and a function to scale to a given brightness, I'm sure there are papers that talk about this. It's not going to be easy though, because "perceived brightness" is heavily influenced by the surrounding colors. But I'm sure that there's something out there that can at least normalise a color based on the average sensitivity of the eye.

> Well, here is a file where I added luminance unification to your script, using the default selected and active colors as the reference. It basically scales the color until any component reaches 1, and then mixes in white (desaturates) if that was not enough to reach the goal. With *so* much color science going on, I feel that this is not something that should be addressed/implemented for bone colors alone. If we want to have some calculation of the preceived brighness of a color, and a function to scale to a given brightness, I'm sure there are papers that talk about this. It's not going to be easy though, because "perceived brightness" is heavily influenced by the surrounding colors. But I'm sure that there's something out there that can at least normalise a color based on the average sensitivity of the eye.
Author
Member

I also noticed that when the bones are drawn, 50 is subtracted from the Normal color, so the color in the settings does not reflect the actual appearance

Holy shit, you're right. This is huge, and it's weird! This means that the selected and normal colors of the presets can be set to the same colors, and this hard-coded value reduction in the normal color will still allow the selection state to be very clear. Wow, that is such a strange decision in the code... I'm surprised I didn't catch that, but I'm glad you did!

luminance unification

I think it's working pretty well! I could see this being a viable way to go for cutting down bone color settings from 3 to 1!

What I think would be great at some point in the future then, is to remove that hard-coded value reduction from the base color, implement your luminosity based selection state indication, and provide 20 nice and distinct presets for the just the base color, while removing the customization of selected and active colors.

But I'm afraid this might be a bit too much for me and my coding skills, so what I will probably do that is within my power, is to update the proposal and the PRs to just use your luminosity-based color logic with the existing 3-color system that we have. And then that can still be the baseline for further development, if somebody more skilled wants to tackle that in future.

> I also noticed that when the bones are drawn, 50 is subtracted from the Normal color, so the color in the settings does not reflect the actual appearance Holy shit, you're right. This is huge, and it's weird! This means that the selected and normal colors of the presets can be set to the same colors, and this hard-coded value reduction in the normal color will still allow the selection state to be very clear. Wow, that is such a strange decision in the code... I'm surprised I didn't catch that, but I'm glad you did! > luminance unification I think it's working pretty well! I could see this being a viable way to go for cutting down bone color settings from 3 to 1! What I think would be great at some point in the future then, is to remove that hard-coded value reduction from the base color, implement your luminosity based selection state indication, and provide 20 nice and distinct presets for the just the base color, while removing the customization of selected and active colors. But I'm afraid this might be a bit too much for me and my coding skills, so what I will probably do that is within my power, is to update the proposal and the PRs to just use your luminosity-based color logic with the existing 3-color system that we have. And then that can still be the baseline for further development, if somebody more skilled wants to tackle that in future.

With so much color science going on, I feel that this is not something that should be addressed/implemented for bone colors alone. If we want to have some calculation of the preceived brighness of a color, and a function to scale to a given brightness, I'm sure there are papers that talk about this. It's not going to be easy though, because "perceived brightness" is heavily influenced by the surrounding colors. But I'm sure that there's something out there that can at least normalise a color based on the average sensitivity of the eye.

I used luminance, which is a standard thing and computed as basically a weighted average of the channel values based on perceptual statistics. The only trick I figured out myself (by looking at how HSV works) is how to adjust the luminance of a color without changing its hue.

> With *so* much color science going on, I feel that this is not something that should be addressed/implemented for bone colors alone. If we want to have some calculation of the preceived brighness of a color, and a function to scale to a given brightness, I'm sure there are papers that talk about this. It's not going to be easy though, because "perceived brightness" is heavily influenced by the surrounding colors. But I'm sure that there's something out there that can at least normalise a color based on the average sensitivity of the eye. I used luminance, which is a standard thing and computed as basically a weighted average of the channel values based on perceptual statistics. The only trick I figured out myself (by looking at how HSV works) is how to adjust the luminance of a color without changing its hue.
Author
Member

The proposal now uses Alexander's luminance math!

I updated the screenshots, added a note about and a link to the "Unify Selected/Active" behaviour task.

Most importantly, I updated the .blend file such that anybody can just download and open it to see the proposed colors on their end.

The proposal now uses Alexander's luminance math! I updated the screenshots, added a note about and a link to the "Unify Selected/Active" behaviour task. Most importantly, I updated the .blend file such that anybody can just download and open it to see the proposed colors on their end.
Member

I played around with the new blend file, and to my eye it's still not clear what is and isn't selected if I don't already know.

I agree with the general idea of using perceived luminance to distinguish states here. But for that to work, I think we need to make the bone colors for each state the same perceived luminance (e.g. all unselected colors have the same perceived luminance, all selected colors have the same perceived luminance, etc.). Which currently isn't the case, particularly for unselected.

Additionally, human color perception is weird, and a simple weighted average of the RGB channels doesn't actually cut it for highly saturated colors. If we're going to do this algorithmically rather than by hand, I recommend we do the computations in a more perceptually uniform color space, like OkLab.

I played around with the new blend file, and to my eye it's still not clear what is and isn't selected if I don't already know. I agree with the general idea of using perceived luminance to distinguish states here. But for that to work, I think we need to make the bone colors for each state the same perceived luminance (e.g. all unselected colors have the same perceived luminance, all selected colors have the same perceived luminance, etc.). Which currently isn't the case, particularly for unselected. Additionally, human color perception is weird, and a simple weighted average of the RGB channels doesn't actually cut it for highly saturated colors. If we're going to do this algorithmically rather than by hand, I recommend we do the computations in a more perceptually uniform color space, like [OkLab](https://bottosson.github.io/posts/oklab/).

Additionally, human color perception is weird, and a simple weighted average of the RGB channels doesn't actually cut it for highly saturated colors. If we're going to do this algorithmically rather than by hand, I recommend we do the computations in a more perceptually uniform color space, like OkLab.

I agree, but simple luminance is about the limit of my own understanding of the color stuff :)

> Additionally, human color perception is weird, and a simple weighted average of the RGB channels doesn't actually cut it for highly saturated colors. If we're going to do this algorithmically rather than by hand, I recommend we do the computations in a more perceptually uniform color space, like [OkLab](https://bottosson.github.io/posts/oklab/). I agree, but simple luminance is about the limit of my own understanding of the color stuff :)

That OkLab page contains some code, so it may be easy to try it.

Actually, now I wonder if the luminance should actually have been computed in linear space rather than gamma, and whether these color theme values are linear or gamma corrected. Any ideas?

That OkLab page contains some code, so it may be easy to try it. Actually, now I wonder if the luminance should actually have been computed in linear space rather than gamma, and whether these color theme values are linear or gamma corrected. Any ideas?
Member

That OkLab page contains some code, so it may be easy to try it.

Yeah. Even further, in another post he derives an OkHSL space that might be easier to work with for this. The code is a little more involved, but he does provide code and it should be straightforward to copy/paste and translate to Python or whatnot.

Actually, now I wonder if the luminance should actually have been computed in linear space rather than gamma, and whether these color theme values are linear or gamma corrected. Any ideas?

Luminance (following the technical definition) should always be computed in linear space. And the weighted channel average is actually correct for that. But luminance (again, by technical definition) doesn't actually correspond precisely to perceived brightness. This is particularly true for highly saturated blues.

Computing perceived brightness consistently is tricky (e.g. OkLab also doesn't fully succeed, it just gets a lot closer), but it definitely involves nonlinearity in the computations.

As for whether the bone color RGB values are interpreted linearly or not... that's a great question. I did a quick test, and the results strongly suggest it's non-linear sRGB. But it might be worth checking Blender's source to be sure.

> That OkLab page contains some code, so it may be easy to try it. Yeah. Even further, in another post he derives an [OkHSL](https://bottosson.github.io/posts/colorpicker/) space that might be easier to work with for this. The code is a little more involved, but he does provide code and it should be straightforward to copy/paste and translate to Python or whatnot. > Actually, now I wonder if the luminance should actually have been computed in linear space rather than gamma, and whether these color theme values are linear or gamma corrected. Any ideas? Luminance (following the technical definition) should always be computed in linear space. And the weighted channel average is actually correct for that. But luminance (again, by technical definition) doesn't actually correspond precisely to *perceived brightness*. This is particularly true for highly saturated blues. Computing perceived brightness consistently is tricky (e.g. OkLab also doesn't fully succeed, it just gets a lot closer), but it definitely involves nonlinearity in the computations. As for whether the bone color RGB values are interpreted linearly or not... that's a great question. I did a quick test, and the results strongly suggest it's non-linear sRGB. But it might be worth checking Blender's source to be sure.

As for whether the bone color RGB values are interpreted linearly or not... that's a great question. I did a quick test, and the results strongly suggest it's non-linear sRGB. But it might be worth checking Blender's source to be sure.

It's sRGB, see use_bone_color() in source/blender/draw/engines/overlay/overlay_armature.cc. It calls srgb_to_linearrgb_v4() to convert to linear for passing onto the next overlay drawing stage.

> As for whether the bone color RGB values are interpreted linearly or not... that's a great question. I did a quick test, and the results strongly suggest it's non-linear sRGB. But it might be worth checking Blender's source to be sure. It's sRGB, see `use_bone_color()` in `source/blender/draw/engines/overlay/overlay_armature.cc`. It calls `srgb_to_linearrgb_v4()` to convert to linear for passing onto the next overlay drawing stage.
Author
Member

This proposal has been discussed in today's Animation Module Meeting.

Following decisions were made, unless I missed any:

  • Sort the presets by Hue, so that users don't get caught off guard when assigning 2 presets far from each other in the list, only to find that they are not that distinct from each other.
  • Let's use the OKLab way of calculating luminance values that Nathan suggested, and then pick a luminance value for unselected, selected, and active, and then pick some nice base colors.
  • A button to expose this functionality to automatically derive selected/active colors could be added for convenience, but considering good presets should minimize the demand for customizing the colors in the first place, this is rather low priority.
  • Let's push this to 4.0 since it's not a new feature.

I will update the proposal text as well as the PRs accordingly, soon.

This proposal has been discussed in [today's Animation Module Meeting](https://devtalk.blender.org/t/2023-10-05-animation-rigging-module-meeting-upcoming/31420). Following decisions were made, unless I missed any: - Sort the presets by Hue, so that users don't get caught off guard when assigning 2 presets far from each other in the list, only to find that they are not that distinct from each other. - Let's use the OKLab way of calculating luminance values that Nathan suggested, and then pick a luminance value for unselected, selected, and active, and then pick some nice base colors. - A button to expose this functionality to automatically derive selected/active colors could be added for convenience, but considering good presets should minimize the demand for customizing the colors in the first place, this is rather low priority. - Let's push this to 4.0 since it's not a new feature. I will update the proposal text as well as the PRs accordingly, soon.
Member

@Mets
Here's a Python implementation of OkHSL: okhsl.py
(It's a fair bit of code, but is just a straightforward translation of the C code to Python.)

The main function you'll probably want to use is okhsl_to_srgb(). It just takes a Hue-Saturation-Lightness color and converts it to non-linear sRGB, which can be plugged straight into the bone colors.

For example, this prints a list of sRGB colors with 20 different hues, 90% saturation, and 30% lightness:

for h in range(20):
    hsl = HSL(h / 20.0, 0.9, 0.3)
    print(okhsl_to_srgb(hsl))
@Mets Here's a Python implementation of OkHSL: [okhsl.py](/attachments/c7d83ca5-ec9c-4235-9fa9-3a67710b85b8) (It's a fair bit of code, but is just a straightforward translation of the C code to Python.) The main function you'll probably want to use is `okhsl_to_srgb()`. It just takes a Hue-Saturation-Lightness color and converts it to non-linear sRGB, which can be plugged straight into the bone colors. For example, this prints a list of sRGB colors with 20 different hues, 90% saturation, and 30% lightness: ```python for h in range(20): hsl = HSL(h / 20.0, 0.9, 0.3) print(okhsl_to_srgb(hsl)) ```
12 KiB

The main function you'll probably want to use is okhsl_to_srgb(). It just takes a Hue-Saturation-Lightness color and converts it to non-linear sRGB, which can be plugged straight into the bone colors.

Note that because of the offset applied to wire color, you need to add 50/255 to the 'normal' color rgb channels after okhsl_to_srgb if you want the actual color lightness unification to target the wire color rather than the solid fill.

This isn't the case for the active and selected colors, so for those okhsl_to_srgb can be used directly.

> The main function you'll probably want to use is `okhsl_to_srgb()`. It just takes a Hue-Saturation-Lightness color and converts it to non-linear sRGB, which can be plugged straight into the bone colors. Note that because of the offset applied to wire color, you need to add 50/255 to the 'normal' color rgb channels after `okhsl_to_srgb` if you want the actual color lightness unification to target the wire color rather than the solid fill. This isn't the case for the active and selected colors, so for those `okhsl_to_srgb` can be used directly.
Member

@Mets and I had a bit of a powow together, trying to get the OkLab stuff working. And the bottom line is that when using any reasonably simple model (like weighted RGB averages, OkLab, etc.), generating consistently good results automatically is going to be challenging. And I don't think this is something we can tackle before 4.0.

So for now @Mets is going use OkLab as a tool, but hand-tweak the colors as best he can to have uniform perceived luminance.

Automating the creation of the colors (e.g. based on user-specified hues) may still be worth investigating in the future. But doing it well will likely be challenging.

@Mets and I had a bit of a powow together, trying to get the OkLab stuff working. And the bottom line is that when using any reasonably simple model (like weighted RGB averages, OkLab, etc.), generating consistently good results automatically is going to be challenging. And I don't think this is something we can tackle before 4.0. So for now @Mets is going use OkLab as a tool, but hand-tweak the colors as best he can to have uniform perceived luminance. Automating the creation of the colors (e.g. based on user-specified hues) may still be worth investigating in the future. But doing it well will likely be challenging.
Author
Member

As per the last module meeting, it seems this task will be tackled along with Unified Active/Selected colors, among other issues related to bone colors and theme customization, targetting 4.1 instead of 4.0.

I think this task will be dormant now, but I'll leave it open until a new parent task is created.

As per the [last module meeting](https://devtalk.blender.org/t/2023-10-17-animation-rigging-module-meeting/31647), it seems this task will be tackled along with [Unified Active/Selected colors](https://projects.blender.org/blender/blender/issues/112943), among other issues related to bone colors and theme customization, targetting 4.1 instead of 4.0. I think this task will be dormant now, but I'll leave it open until a new parent task is created.
Author
Member

I think it makes sense to close this now, as this can be considered a design task with a finished design, which now constitutes one part this new, bigger rework: #113941.

I think it makes sense to close this now, as this can be considered a design task with a finished design, which now constitutes one part this new, bigger rework: https://projects.blender.org/blender/blender/issues/113941.
Blender Bot added the
Status
Archived
label 2023-10-19 17:16:04 +02:00
Author
Member

For the record, I've been using my final set of custom colors ever since, and just told my rig generation system to set the bone's custom colors to my theme colors. That means my colors are currently propagating to my animators, so for now they can't customize it. They don't want to, so that's no big deal.

My experience with them has been as expected: Instead of having 3 fantastically popping colors, I have 20 super good enough colors.

Sure, the red and the blue don't pop as crazily as they used to, since they had to be toned down so their perceived lightness is similar to that of other hues when deselected. For me, totally worth it for the ability to have all kinds of colors that look super good enough mixed together in all selection states.

For the record, I've been using my final set of custom colors ever since, and just told my rig generation system to set the bone's custom colors to my theme colors. That means my colors are currently propagating to my animators, so for now they can't customize it. They don't want to, so that's no big deal. My experience with them has been as expected: Instead of having 3 fantastically popping colors, I have 20 super good enough colors. Sure, the red and the blue don't pop as crazily as they used to, since they had to be toned down so their perceived lightness is similar to that of other hues when deselected. For me, totally worth it for the ability to have all kinds of colors that look super good enough mixed together in all selection states.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112635
No description provided.