python api - python hsv values inconsistent with color picker values #50110
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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-addons#50110
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Blender Version
Blender 2.78a and Blender 2.77a
Short description of error
converted HSV values in python API are inconsistent with the displayed color picker values
Exact steps for others to reproduce the error
In python console:
import bpy, colorsys
bpy.context.scene.world.horizon_color = colorsys.hsv_to_rgb(0.5, 0.5, 0.5)
or:
from mathutils import Color
import bpy
c = Color()
c.hsv = (0.5, 0.5, 0.5)
bpy.context.scene.world.horizon_color = c
Both code snippets displays the HSV values: (0.5, 0.27, 0.735) in the color picker.
Changed status to: 'Open'
Added subscriber: @paramcookie
Added subscriber: @brecht
Changed status from 'Open' to: 'Archived'
There are multiple ways to do HSV to RGB conversion, and it also depends on the color space (sRGB, linear, ..).
colorsys
is a module part of Python itself which uses a different formula than Blender, we don't consider that to be a bug.Thank you for the reply!
When printing out the value of
bpy.context.scene.world.horizon_color.hsv
, the output value is also inconsistent for the hsv values for the horizon color in the color picker.Is the
mathutils.Color
class also inconsistent with the color conversion in Blender?The HSV value edited in the color picker is in display space (sRGB by default). The values in the API are in scene linear space.