Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/guis/imgui_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def update(self):
# the UI will be used to modify the line
self._line = figure[0, 0]["sine-wave"]

# get the current line RGB values
rgb_color = self._line.colors[:-1]
# get the current line RGBA values
rgba_color = self._line.colors
# make color picker
changed_color, rgb = imgui.color_picker3("color", col=rgb_color)
changed_color, rgba = imgui.color_picker3("color", col=imgui.ImVec4(tuple(rgba_color)))
Comment thread
kushalkolar marked this conversation as resolved.

# get current line color alpha value
alpha = self._line.colors[-1]
Expand All @@ -65,6 +65,7 @@ def update(self):
# if RGB or alpha changed
if changed_color | changed_alpha:
# set new color along with alpha
rgb = (rgba[0], rgba[1], rgba[2])
self._line.colors = [*rgb, new_alpha]

# example of a slider, you can also use input_float
Expand Down
4 changes: 3 additions & 1 deletion examples/image_volume/image_volume_render_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def update(self):
_, self.graphic.substep_size = imgui.slider_float(
"substep_size", v=self.graphic.substep_size, v_max=10.0, v_min=0.1,
)
_, self.graphic.emissive = imgui.color_picker3("emissive color", col=self.graphic.emissive.rgb)

col = imgui.ImVec4((*self.graphic.emissive.rgb, 1))
_, self.graphic.emissive = imgui.color_picker3("emissive color", col=col)

if self.graphic.mode == "slice":
imgui.text("Select plane defined by:\nax + by + cz + d = 0")
Expand Down
Binary file modified examples/screenshots/imgui_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading