diff --git a/doc/changelog.d/229.test.md b/doc/changelog.d/229.test.md new file mode 100644 index 00000000..5a1ff79f --- /dev/null +++ b/doc/changelog.d/229.test.md @@ -0,0 +1 @@ +test: Add tests for dark mode \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 9aba9fe8..2db09d7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-tools-visualization-interface" -version = "0.5.dev0" +version = "0.7.dev0" description = "A Python visualization interface for PyAnsys libraries" readme = "README.rst" requires-python = ">=3.10,<4" diff --git a/tests/test_generic_plotter.py b/tests/test_generic_plotter.py index 1af1b57b..cab27d2b 100644 --- a/tests/test_generic_plotter.py +++ b/tests/test_generic_plotter.py @@ -148,3 +148,33 @@ def test_screenshot(tmp_path): pl.plot(sphere) pl.show(screenshot=tmp_path / "screenshot.png") assert Path(tmp_path / "screenshot.png").is_file() + + +def test_dark_mode(): + """Test dark mode different functionalities.""" + # Test auto dark mode + sphere = pv.Sphere() + pl = Plotter() + pl.backend.scene.background_color = [10, 10, 10] + pl.plot(sphere) + pl.show() + + # Test auto dark mode below threshold + sphere = pv.Sphere() + pl = Plotter() + pl.backend.scene.background_color = [10, 10, 10] + pl.plot(sphere) + pl.show() + + # Test auto dark mode above threshold + sphere = pv.Sphere() + pl = Plotter() + pl.backend.scene.background_color = [0, 121, 255] + pl.plot(sphere) + pl.show() + + # Test manual dark mode + sphere = pv.Sphere() + pl = Plotter() + pl.plot(sphere) + pl.show(dark_mode=True)