































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































Thearen't used much anymore.collection of widgets (buttons, scroll bars, sliders, etc.) thatwith mouse events, keyboard events, and others; and aoperating system's windowing system; classes for dealingAWT contains classes for interacting with the hostfoundational graphics framework for Java.AWT is the Java Abstract Window Toolkit, which is theGUIs in Java: AWT, Swing, and Java2D. We’ll be talking about three related frameworks for doing
(^) java.awt
(^) package and sub-packages make up the AWT.
Thequality.operating system can employ tricks to enhance graphicsJava2D is based on a real number coordinate system, so thetransformations that can be done to them. Java2D is a system for describing shapes, images, and (^) java.awt.geom
(^) package and several others make up
Java2D.
the visible spectrum. In Physics, color is associated with a certain wavelength on Yellow light is EM radiation at about 600nm wavelength.
three cone types are stimulated by the light.The human eye perceives color by the degree to which thesensitive to a different range of the color spectrum.The human eye has three types of cone cells that are each blue cones is seen as yellow.Light that stimulates the red and green cones but not the
400nm
500nm
600nm
700nm
violet
blue
cyan
green
yellow
red
color that can be displayed onscreen.are levels of red, green, and blue light, you get the "universe" ofIf you construct a three-dimensional space where the axesalmost all of the visible spectrum can be simulated.^ By emitting differing ratios of red, blue, and green light, 400nm
500nm
600nm
700nm
violet
blue
cyan
green
yellow
red
This shows the color values of the corners of the colorspace.
(0,0,0) (1,1,1)
Magenta (Red + Blue)
Yellow (Red + Green)
(Green + Blue) Cyan
(1,0,1)
(1,1,0)
(0,1,1)
(0,0,1) Blue
(0,1,0) Green White
Black
(1,0,0) Red
( 0.5 component is half way bet ween the minimum and the maximumThis is another slice of the colorspace, taken where the blue
).
(1,1,1)
(1,0,1)
(1,1,0)
(0,1,1)
(0,0,1) Blue
(0,1,0) Green White
PurpleGray
(1,0,0) Red
Magenta (Red + Blue)
Yellow (Red + Green)
(Green + Blue) Cyan
at its maximum (This is a slice of the colorspace taken where the blue component is
1.
).
(1,1,1)
(1,0,1)
(1,1,0)
(0,1,1)
(0,0,1) Blue
(0,1,0) Green White
(1,0,0) Red
Magenta (Red + Blue)
Yellow (Red + Green)
(Green + Blue) Cyan
α (^) = 0.
α (^) = 0.
α (^) = 0.
α (^) = 0.
α (^) = 1.
The class
(^) java.awt.Color
(^) allows you to de
fine a color to use
You construct afor painting shapes.
(^) Color
(^) object with RGB or RGBA parameters,
or use one of the prede
fined colors.
Each component can be speciyields a 32-bit color value.limits of human perception). The addition of alpha (8-bits)24-bits of color or 16,777,216 colors (generally beyond theeach of the red, green, and blue components, for a total ofMost modern display hardware supports 8-bit parameters for
fied as a fraction of full
intensity (
0.0f
(^) - (^) 1.0f
) or as an 8-bit unsigned value (
(^0)
255
).
are usually positive numbers.from standard mathematical coordinates. Graphics coordinatesof CRTs (left-to-right, top-to-bottom) and have a Y-axis invertedCoordinates in computer graphics are based on the raster pattern
(20.0,10.0)
(20.0,10.0)
Math
Computer Graphics
Here are the coordinates of a line drawn bet ween t wo points.
(70.0,30.0)