正在加载图片...
Color类的一些方法 Method Description public color( int r, int g, Creates a color based on red, green and blue contents int b expressed as integers from 0 to 255 public Co1or(f1。atx Creates a color based on red, green and blue contents f1oatg,f1。atb) expressed as floating-point values from 0.0 to 1.0 public int getRed( Returns a value between 0 and 255 representing the red / Color class content public int getGreen() Returns a value between 0 and 255 representing the green // Color class content public int getBlueo) Returns a value between 0 and 255 representing the blue / Color class content public color getcolor ( Returns a color object representing the current color for the // Graphics class graphics context public void setcolor( Color Sets the current color for drawing with the graphics context c )// Graphics class Fig. 11.4 Color methods and color-re lated Graphics methods. 2021/2/24 北京理工大学计算机系(共48页)2021/2/24 北京理工大学计算机系(共48页) 11 Color类的一些方法 Method Description public Color( int r, int g, int b ) Creates a color based on red, green and blue contents expressed as integers from 0 to 255. public Color( float r, float g, float b ) Creates a color based on red, green and blue contents expressed as floating-point values from 0.0 to 1.0. public int getRed() // Color class Returns a value between 0 and 255 representing the red content. public int getGreen() // Color class Returns a value between 0 and 255 representing the green content. public int getBlue() // Color class Returns a value between 0 and 255 representing the blue content. public Color getColor() // Graphics class Returns a Color object representing the current color for the graphics context. public void setColor( Color c ) // Graphics class Sets the current color for drawing with the graphics context. Fig. 11.4 Color methods and c olor-related Graphics methods
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有