segment_color Function

private function segment_color(self, c, i) result(rgba4)

Color i of c (color_a or color_b), or the frame's color if c is not allocated.

Arguments

Type IntentOptional Attributes Name
type(CustomLineSegments), intent(in) :: self
real(kind=c_float), intent(in), allocatable :: c(:,:)

(4, n): [r, g, b, a]

integer, intent(in) :: i

1 to num_segments

Return Value real(kind=wp), (4)


Calls

proc~~segment_color~2~~CallsGraph proc~segment_color~2 segment_color proc~color~2 ReferenceFrame%color proc~segment_color~2->proc~color~2

Called by

proc~~segment_color~2~~CalledByGraph proc~segment_color~2 segment_color proc~segment CustomLineSegments%segment proc~segment->proc~segment_color~2

Source Code

    function segment_color(self, c, i) result(rgba4)
        type(CustomLineSegments), intent(in) :: self
        real(c_float), allocatable, intent(in) :: c(:,:)    !! (4, n): [r, g, b, a]
        integer, intent(in) :: i                            !! 1 to num_segments
        real(wp) :: rgba4(4)
        if (allocated(c)) then
            rgba4 = real(c(:, i), wp)
        else
            rgba4 = self%color()
        end if
    end function segment_color