BLF: fade out shadow when text color itself is dark #121222
No reviewers
Labels
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#121222
Loading…
Reference in New Issue
No description provided.
Delete Branch "aras_p/blender:blf_shadow_color"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spawned by discussion in chat: https://blender.chat/channel/sequencer-module?msg=PuiLkG3KfrGAhCeHa
BLF_draw_default_shadowed
and one place inview2d_draw
were using black text shadow color, even if the text itself might be dark enough already (since the color is coming from a theme). So e.g. a black text would result in additional black shadow, which only makes everything more muddy:Make these places fade out the shadow: when color luminance is below 0.5 the shadow starts to fade out, and is completely got when luminance drops below 0.25. This is done by the new helper function
BLF_shadow_auto_color
.Python API (
blf.shadow
) and other existing cases ofBLF_shadow
remain unchanged.@blender-bot build
I should start by saying that yes, the overlay text drawing is a problem. And I have struggled with it forever.
That said, I'm not certain this gets us very far. It does make the dark text look better on a light background for sure. But the auto shadow color here does so with very little context, in that it can only do so based on the text color.
For example, this PR changes
draw_vertical_scale_indicators
to use this. I think this is for drawing the numbers on the vertical axis in Graph Editor. The text shadow there now is set to a (dumb) black. And this PR just makes it use something better if the text color is made brighter. But that removes contrast in that case. So that could be fixed by replacing that black with the background color:This way the text color and its shadow have the same contrast as TH_TEXT and TH_BACK. And using the background color you wouldn't get that "glow" effect when using a white shadow color. You wouldn't notice the shadow at all unless something is placed under it that is far off the background color.
The 3DView overlay text is an entirely different problem though. We could make that
BLF_draw_default_shadowed
smarter, and give it a default parameter of shadow color. So it just uses black unless you supply a specific color.But 3DView can have a background color that is very dark or completely white, yet we only have a single theme setting for text color. So if you set a color that looks good for Grease Pencil it will be bad for regular views.
We do have a
ED_view3d_background_color_get
that does an okay job of getting a background color. So we use that to manufacture both the text and shadow colors. So when the background is dark we use a black shadow and light text, and if a light background use black text and shadow of background color. Basically allow the shadow to get as dark as black, but not allow it to get lighter than the background - which avoid glowing.I'll make a different PR so we can stare at it.
Closing this in favor of #121239
Pull request closed