print Subroutine

private impure elemental subroutine print(this, option)

Type Bound

color

Arguments

Type IntentOptional Attributes Name
class(color), intent(inout) :: this
character(len=*), intent(in), optional :: option

Calls

proc~~print~~CallsGraph proc~print color%print proc~print_cmyk color%print_cmyk proc~print->proc~print_cmyk proc~print_decimal color%print_decimal proc~print->proc~print_decimal proc~print_hex color%print_hex proc~print->proc~print_hex proc~print_hsl color%print_hsl proc~print->proc~print_hsl proc~print_hsv color%print_hsv proc~print->proc~print_hsv proc~print_name color%print_name proc~print->proc~print_name proc~print_rgb color%print_rgb proc~print->proc~print_rgb proc~print_xyz color%print_xyz proc~print->proc~print_xyz

Source Code

   elemental impure subroutine print(this, option)
      class(color), intent(inout) :: this
      character(len=*), intent(in), optional :: option

      if (present(option)) then

         select case (trim(option))
          case ('rgb')
            call this%print_rgb()
            print*,''
          case ('hex')
            call this%print_hex()
            print*,''
          case ('decimal')
            call this%print_decimal()
            print*,''
          case ('cmyk')
            call this%print_cmyk()
            print*,''
          case ('hsv')
            call this%print_hsv()
            print*,''
          case ('hsl')
            call this%print_hsl()
            print*,''
          case ('name')
            call this%print_name()
            print*,''
          case ('xyz')
            call this%print_xyz()
            print*,''
          case default
            error stop 'error: unknown option'
         end select

      else

         call this%print_name()
         call this%print_rgb()
         call this%print_hex()
         call this%print_decimal()
         call this%print_cmyk()
         call this%print_hsv()
         call this%print_hsl()
         call this%print_xyz()
         print*,''

      end if

   end subroutine print