Skip to content

Commit

Permalink
removed unused procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonMiraj committed Jul 7, 2024
1 parent d37b13e commit 81503f1
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/fig_rgb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,4 @@ elemental type(RGB) function int_to_rgb(rgb_int) result(color)
color%b = ibits(rgb_int, 0, rgb_bit_depth)
end function int_to_rgb

function rgb_to_string(color) result(color_string)
type(RGB), intent(in) :: color
character(len=50) :: color_string
real :: alpha

alpha = color%a / 255.0
alpha = min(1.0,alpha)
write(color_string, '(A,I0,A,I0,A,I0,A,F5.3,A)') 'rgba(', color%r, ',', color%g, ',', color%b, ',', alpha, ')'
end function rgb_to_string

elemental type(integer(pixel)) function blend_color(c1, c2) result(blended)
integer(pixel), intent(in) :: c1, c2

type(RGB) :: color1, color2

color1 = int_to_rgb(c1)
color2 = int_to_rgb(c2)

color1%r = (color1%r * (255 - color2%a) + color2%r * color2%a) / 255
color1%g = (color1%g * (255 - color2%a) + color2%g * color2%a) / 255
color1%b = (color1%b * (255 - color2%a) + color2%b * color2%a) / 255

color1%r = min(255, max(0, color1%r))
color1%g = min(255, max(0, color1%g))
color1%b = min(255, max(0, color1%b))

blended = rgb_to_int(color1)
end function blend_color

end module fig_rgb

0 comments on commit 81503f1

Please sign in to comment.