Coverage for src / sdynpy / core / sdynpy_colors.py: 100%
6 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-11 16:22 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-11 16:22 +0000
1# -*- coding: utf-8 -*-
2"""
3Defines the color scheme used in SDynPy. Matches the I-deas color scheme.
4"""
5"""
6Copyright 2022 National Technology & Engineering Solutions of Sandia,
7LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
8Government retains certain rights in this software.
10This program is free software: you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation, either version 3 of the License, or
13(at your option) any later version.
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
20You should have received a copy of the GNU General Public License
21along with this program. If not, see <https://www.gnu.org/licenses/>.
22"""
24from matplotlib.colors import ListedColormap
26colors = {0: [0.0, 0.0, 0.0],
27 1: [0.0, 0.0, 1.0],
28 2: [0.0, 0.329, 1.0],
29 3: [0.0, 0.66, 1.0],
30 4: [0.0, 1.0, 1.0],
31 5: [0.0, 0.33, 0.0],
32 6: [0.0, 0.66, 0.0],
33 7: [0.0, 1.0, 0.0],
34 8: [1.0, 1.0, 0.0],
35 9: [1.0, 0.66, 0.0],
36 10: [1.0, 0.33, 0.0],
37 11: [1.0, 0.0, 0.0],
38 12: [1.0, 0.0, 1.0],
39 13: [1.0, 0.33, 1.0],
40 14: [1.0, 0.66, 1.0],
41 15: [1.0, 1.0, 1.0]}
43color_list = [colors[i] for i in range(len(colors))]
45colormap = ListedColormap(color_list)
47coord_colormap = ListedColormap([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0]])