java.lang.Object
io.github.jwharm.cairobindings.Proxy
org.freedesktop.cairo.Pattern
org.freedesktop.cairo.SolidPattern
A pattern with a solid (uniform) color. It may be opaque or translucent.
-
Constructor Summary
ConstructorsConstructorDescriptionSolidPattern(MemorySegment address) Constructor used internally to instantiate a java SolidPattern object for a nativecairo_pattern_tinstance -
Method Summary
Modifier and TypeMethodDescriptionstatic SolidPatterncreateRGB(double red, double green, double blue) Creates a newPatterncorresponding to an opaque color.static SolidPatterncreateRGBA(double red, double green, double blue, double alpha) Creates a newPatterncorresponding to a translucent color.double[]getRGBA()Gets the solid color for a solid color pattern.Methods inherited from class org.freedesktop.cairo.Pattern
destroy, getDither, getExtend, getFilter, getMatrix, getPatternType, getType, getUserData, setDither, setExtend, setFilter, setMatrix, setUserData, status
-
Constructor Details
-
SolidPattern
Constructor used internally to instantiate a java SolidPattern object for a nativecairo_pattern_tinstance- Parameters:
address- the memory address of the nativecairo_pattern_tinstance
-
-
Method Details
-
createRGB
Creates a newPatterncorresponding to an opaque color. The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped.- Parameters:
red- red component of the colorgreen- green component of the colorblue- blue component of the color- Returns:
- the newly created
SolidPattern - Since:
- 1.0
-
createRGBA
Creates a newPatterncorresponding to a translucent color. The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped.The color is specified in the same way as in
Context.setSourceRGB(double, double, double).- Parameters:
red- red component of the colorgreen- green component of the colorblue- blue component of the coloralpha- alpha component of the color- Returns:
- the newly created
SolidPattern - Since:
- 1.0
-
getRGBA
public double[] getRGBA()Gets the solid color for a solid color pattern.Note that the color and alpha values are not premultiplied.
- Returns:
- a 4-element array with red, green, blue and alpha color components
- Since:
- 1.4
-