Fix #111017: Improvements to the drawing of Color Ramps #111903

Merged
Harley Acheson merged 3 commits from Harley/blender:ColorRamp into main 2023-09-06 00:00:47 +02:00
Member

Color Ramp widget with themed outline, handling of line width changes,
padding fixes, scaling fixes, etc.


Weekend time spend on the Color Ramp widget, based on research done with @lichtwerk. Current code has some issues, some shown below:

image

The outline around the ramp itself is always black and doesn't respect line width. This PR has it use Regular's outline color (respecting alpha) in line width.

This widget has left and right padding so that the handles can be used when at the edges. However this gap gets larger as the widget is scaled down. This PR keeps the same visual padding with scale changes.

The handles don't respect line width and the outline often leaves gaps. This PR has the various parts of the handles line up correctly and positioned and sized correctly with line width change.

The vertical dash indicator changes readability with scale changes. Since the dash lengths are always the same number of pixels they get too long as the widget is scaled down. This PR keeps a proportionally-correct dash length.

The handles currently disappear abruptly when below a size threshold. This PR uses changes to opacity and line width to fade them out nicer.

The contrast difference between active and non-active handles is increased a bit.

Following illustrates how it looks as line-width is changed. Note the outline color is purposely changed to gold for the capture to show contrast.

ColorRampThickness.gif

Color Ramp widget with themed outline, handling of line width changes, padding fixes, scaling fixes, etc. --- Weekend time spend on the Color Ramp widget, based on research done with @lichtwerk. Current code has some issues, some shown below: ![image](/attachments/8de6fffb-d605-4699-8488-f56561c19070) The outline around the ramp itself is always black and doesn't respect line width. This PR has it use Regular's outline color (respecting alpha) in line width. This widget has left and right padding so that the handles can be used when at the edges. However this gap gets larger as the widget is scaled down. This PR keeps the same visual padding with scale changes. The handles don't respect line width and the outline often leaves gaps. This PR has the various parts of the handles line up correctly and positioned and sized correctly with line width change. The vertical dash indicator changes readability with scale changes. Since the dash lengths are always the same number of pixels they get too long as the widget is scaled down. This PR keeps a proportionally-correct dash length. The handles currently disappear abruptly when below a size threshold. This PR uses changes to opacity and line width to fade them out nicer. The contrast difference between active and non-active handles is increased a bit. Following illustrates how it looks as line-width is changed. Note the outline color is purposely changed to gold for the capture to show contrast. ![ColorRampThickness.gif](/attachments/e1e85953-1461-47df-ba1f-fb7968ac09ae)
Harley Acheson added 1 commit 2023-09-03 22:38:12 +02:00
77f7e5a6b2 UI: Improvements to the drawing of Color Ramps
Color Ramp widget with themed outline, handling of line width changes,
padding fixes, scaling fixes, etc.
Harley Acheson added this to the User Interface project 2023-09-03 22:38:46 +02:00
Harley Acheson requested review from Pablo Vazquez 2023-09-03 22:38:56 +02:00
Harley Acheson requested review from Philipp Oeser 2023-09-03 22:39:07 +02:00
Pablo Vazquez approved these changes 2023-09-03 23:34:20 +02:00
Pablo Vazquez left a comment
Member

The definition of attention to detail you all in that thread :)

Thanks for the dedication.

The definition of attention to detail you all in that thread :) Thanks for the dedication.
Member

Just noting that this would fix #111017 (the commit message or title should probably mention this as well).

I am a bit torn on the increased size of the handles (since they now eat away a bit from the actual gradient -- which is now a bit harder to see) but trust you guys on this and overall it is a good improvement.

Just noting that this would fix #111017 (the commit message or title should probably mention this as well). I am a bit torn on the increased size of the handles (since they now eat away a bit from the actual gradient -- which is now a bit harder to see) but trust you guys on this and overall it is a good improvement.
Philipp Oeser approved these changes 2023-09-05 16:25:34 +02:00
Harley Acheson changed title from UI: Improvements to the drawing of Color Ramps to Fix #111017: Improvements to the drawing of Color Ramps 2023-09-05 19:24:35 +02:00
Author
Member

@lichtwerk -I am a bit torn on the increased size of the handles (since they now eat away a bit from the actual gradient -- which is now a bit harder to see)

This PR now keeps them the same size as current. I have updated the animated gif in the first comment.

> @lichtwerk -I am a bit torn on the increased size of the handles (since they now eat away a bit from the actual gradient -- which is now a bit harder to see) This PR now keeps them the same size as current. I have updated the animated gif in the first comment.
Harley Acheson added 2 commits 2023-09-05 20:14:58 +02:00
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit 8a3766e241 into main 2023-09-06 00:00:47 +02:00
Harley Acheson deleted branch ColorRamp 2023-09-06 00:00:48 +02:00
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 project
No Assignees
3 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#111903
No description provided.