diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 3f61f8d764..5d9d54a976 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2990,6 +2990,24 @@ contains call fatal_error() end if + ! Check for color + if (check_for_node(node_meshlines, "color")) then + + ! Check and make sure 3 values are specified for RGB + if (get_arraysize_double(node_meshlines, "color") /= 3) then + message = "Bad RGB for meshlines color " & + // "in plot " // trim(to_str(pl % id)) + call fatal_error() + end if + + call get_node_array(node_meshlines, "color", & + pl % meshlines_color % rgb) + else + + pl % meshlines_color % rgb = (/ 0, 0, 0 /) + + end if + ! Check if the specified tally mesh exists if (mesh_dict % has_key(pl % meshlines_id)) then pl % meshlines_id = mesh_dict % get_key(pl % meshlines_id) diff --git a/src/plot.F90 b/src/plot.F90 index 25c0c7123a..888b50dff7 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -191,6 +191,7 @@ contains logical :: in_mesh integer :: x, y ! pixel location + integer :: r, g, b ! RGB color for meshlines pixels integer :: xrange(2), yrange(2) ! range of pixel locations integer :: i, j ! loop indices integer :: ijk(3) @@ -207,6 +208,10 @@ contains m => meshes(pl % meshlines_id) + r = pl % meshlines_color % rgb(1) + g = pl % meshlines_color % rgb(2) + b = pl % meshlines_color % rgb(3) + select case (pl % basis) case(PLOT_BASIS_XY) xyz_ll_plot(1) = pl % origin(1) - pl % width(1) / 2.0 @@ -251,18 +256,18 @@ contains ! draw black lines do x = xrange(1), xrange(2) do plus = 0, pl % meshlines_width - call set_pixel(img, x, yrange(1) + plus, 0, 0, 0) - call set_pixel(img, x, yrange(2) + plus, 0, 0, 0) - call set_pixel(img, x, yrange(1) - plus, 0, 0, 0) - call set_pixel(img, x, yrange(2) - plus, 0, 0, 0) + call set_pixel(img, x, yrange(1) + plus, r, g, b) + call set_pixel(img, x, yrange(2) + plus, r, g, b) + call set_pixel(img, x, yrange(1) - plus, r, g, b) + call set_pixel(img, x, yrange(2) - plus, r, g, b) end do end do do y = yrange(2), yrange(1) do plus = 0, pl % meshlines_width - call set_pixel(img, xrange(1) + plus, y, 0, 0, 0) - call set_pixel(img, xrange(2) + plus, y, 0, 0, 0) - call set_pixel(img, xrange(1) - plus, y, 0, 0, 0) - call set_pixel(img, xrange(2) - plus, y, 0, 0, 0) + call set_pixel(img, xrange(1) + plus, y, r, g, b) + call set_pixel(img, xrange(2) + plus, y, r, g, b) + call set_pixel(img, xrange(1) - plus, y, r, g, b) + call set_pixel(img, xrange(2) - plus, y, r, g, b) end do end do diff --git a/src/plot_header.F90 b/src/plot_header.F90 index 5a301f8809..e66bf9077e 100644 --- a/src/plot_header.F90 +++ b/src/plot_header.F90 @@ -27,6 +27,7 @@ module plot_header integer :: pixels(3) ! pixel width/height of plot slice integer :: meshlines_id = -1 ! id of the mesh to plot lines of integer :: meshlines_width ! pixel width of meshlines + type(ObjectColor) :: meshlines_color ! Color for meshlines type(ObjectColor) :: not_found ! color for positions where no cell found type(ObjectColor), allocatable :: colors(:) ! colors of cells/mats end type ObjectPlot