Skip to content

Commit

Permalink
Add get_r(), get_g(), get_b() procedures.
Browse files Browse the repository at this point in the history
Signed-off-by: Seyed Ali Ghasemi <info@gha3mi.com>
  • Loading branch information
gha3mi committed Apr 26, 2024
1 parent d50125e commit edbf9c1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/forcolor.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ module forcolor
procedure, private :: get_hsv
procedure, private :: get_hsl
procedure, private :: get_xyz
procedure :: get_r
procedure :: get_g
procedure :: get_b
procedure :: print
procedure, private :: print_name
procedure, private :: print_rgb
Expand Down Expand Up @@ -389,6 +392,36 @@ end subroutine get
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
elemental pure function get_r(this) result(r)
class(color), intent(in) :: this
integer(ik) :: r
r = this%r
end function
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
elemental pure function get_g(this) result(g)
class(color), intent(in) :: this
integer(ik) :: g
g = this%g
end function
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
elemental pure function get_b(this) result(b)
class(color), intent(in) :: this
integer(ik) :: b
b = this%b
end function
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
elemental pure subroutine get_name(this, name)
Expand Down

0 comments on commit edbf9c1

Please sign in to comment.