Add Color Attribute: hex colors don't work #99036

Closed
opened 2022-06-21 04:28:33 +02:00 by Scurest · 10 comments
Contributor

System Information
Operating system: Linux

Blender Version
Broken: blender-3.3.0-alpha+master.e6e9f1ac5a2d

Short description of error
When creating a new color attribute, if a hex color is entered as the default color, it is not gamma corrected properly.

Exact steps for others to reproduce the error
Add a color attribute to the default cube (the + button in the Color Attributes panel). I'll use Byte Color, but it happens for Float Color the same way. Click the Color field, pick Hex, and enter #FA8072 (which is 250, 128, 114). Hit OK. You can see the color on the cube is different than the color shown in the color picker. The values in the spreadsheet are also wrong.

ss2.png

If you switch to the RGB tab after you put in the hex color, you can read the values (0.980 0.502 0.447). It appears that #FA8072 is not being gamma corrected (not converted from sRGB). Interestingly if you put the same hex color in a color picker for a shader node, you will get the correct (linear) result in the RGB tab. It seems only this particular color picker is affected.

**System Information** Operating system: Linux **Blender Version** Broken: blender-3.3.0-alpha+master.e6e9f1ac5a2d **Short description of error** When creating a new color attribute, if a hex color is entered as the default color, it is not gamma corrected properly. **Exact steps for others to reproduce the error** Add a color attribute to the default cube (the + button in the Color Attributes panel). I'll use Byte Color, but it happens for Float Color the same way. Click the Color field, pick Hex, and enter #FA8072 (which is 250, 128, 114). Hit OK. You can see the color on the cube is different than the color shown in the color picker. The values in the spreadsheet are also wrong. ![ss2.png](https://archive.blender.org/developer/F13210024/ss2.png) If you switch to the RGB tab after you put in the hex color, you can read the values (0.980 0.502 0.447). It appears that #FA8072 is not being gamma corrected (not converted from sRGB). Interestingly if you put the same hex color in a color picker for a shader node, you will get the correct (linear) result in the RGB tab. It seems only this particular color picker is affected.
Author
Contributor

Added subscriber: @scurest

Added subscriber: @scurest
Scurest changed title from Add Color Attribute: hex input doesn't work to Add Color Attribute: hex colors don't work 2022-06-21 04:29:04 +02:00
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Author
Contributor

Perhaps in GEOMETRY_OT_color_attribute_add, RNA_def_property_subtype(prop, PROP_COLOR_GAMMA); should use PROP_COLOR instead of PROP_COLOR_GAMMA?

7140016838/source/blender/editors/geometry/geometry_attributes.cc (L409)

Perhaps in GEOMETRY_OT_color_attribute_add, `RNA_def_property_subtype(prop, PROP_COLOR_GAMMA);` should use PROP_COLOR instead of PROP_COLOR_GAMMA? https://github.com/blender/blender/blob/714001683888770f9d870ba73edd65f4c2757bda/source/blender/editors/geometry/geometry_attributes.cc#L409

Added subscriber: @Limarest

Added subscriber: @Limarest
[blender_51snrdCm2U.mp4](https://archive.blender.org/developer/F13217700/blender_51snrdCm2U.mp4)
Member

Added subscribers: @Jeroen-Bakker, @JulienKaspar

Added subscribers: @Jeroen-Bakker, @JulienKaspar
Member

@Jeroen-Bakker Is this maybe related to #72424 or does the fix from @Limarest seem reasonable?

@Jeroen-Bakker Is this maybe related to #72424 or does the fix from @Limarest seem reasonable?

This issue was referenced by cf9dd3c0d8

This issue was referenced by cf9dd3c0d8304cc8915f8b7d1f703e26e12c45f5
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jeroen Bakker self-assigned this 2022-07-25 12:15:33 +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
6 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#99036
No description provided.