[UP]


Manual Reference Pages  - color (3)

NAME

color(3f) - [M_draw:COLOR] Set current color (LICENSE:PD)

CONTENTS

Synopsis
Description
Option
Example

SYNOPSIS

subroutine color(col) integer,intent(in) :: col

DESCRIPTION

Set the current color. The standard colors are as follows:

      d_black  =  0  d_red      =  1  d_green  =  2  d_yellow  =  3
      d_blue   =  4  d_magenta  =  5  d_cyan   =  6  d_white   =  7

OPTION

COL A color number from 0 to 255. To define additional colors see mapcolor(3f).

EXAMPLE

Sample program:

    program demo_color
    use M_draw
    real    :: b=0.5
    real    :: y1,y2,ym,x1,x2
    real    :: width=50.0/8.0,width2
    integer :: i
    integer :: ipaws
       !! set up long bar as plotting area
       call prefsize(1000,200)
       call vinit(’ ’) ! start graphics using device $M_DRAW_DEVICE
       call page(-25.0-b, 25.0+b, -5.0-b, 5.0+b)
       call textsize( 3.5, 4.0)
       call font(’futura.m’)
       call centertext(.true.)
       call linewidth(90)
       y1=-5
       y2=5
       ym=0
       x1=-25+.05*width
       ! draw colored rectangle and a circle and label center of circle
       ! and repeat from colors 0 to 7.
       width2=width*0.95
       call linewidth(40)
       do i=0,7
          call color(i)
          x2=x1+width2
          call polyfill(.true.)
          call makepoly()
          call rect(x1,y1,x2,y2)
          call closepoly()
          call color(mod(i+1,7)+1)
          call move2((x1+x2)/2.0,ym)
          call print(i)     ! convert number to string and draw it
          call polyfill(.false.)
          call circle((x1+x2)/2.0, ym, (x2-x1)/2.10)
          x1=x1+width
       enddo
       ipaws=getkey()
       call vexit()
    end program demo_color


color (3) March 11, 2021
Generated by manServer 1.08 from 756693e4-d3de-4bb9-9238-da73bb816c0a using man macros.