EFStyleRandomRectangleParams
public class EFStyleRandomRectangleParams : EFStyleParams
Parameters for random rectangle QR code styling.
This class defines the styling parameters for random rectangle QR codes, which create QR codes with randomly sized and colored rectangles for each dark module. This creates QR codes with a unique, artistic appearance that maintains scannability.
## Features
- Random rectangle generation for each dark module
- Variable rectangle sizes and colors
- Artistic, non-uniform appearance
- Icon and backdrop support
- Unique visual style
## Usage
let params = EFStyleRandomRectangleParams(
icon: icon,
backdrop: backdrop,
color: .green
)
let style = EFQRCodeStyle.randomRectangle(params)
## Visual Characteristics
- Each dark module is represented by randomly sized rectangles
- Colors vary around the base color with random offsets
- Creates an artistic, non-uniform appearance
- Maintains QR code structure and scannability
-
The default backdrop configuration for random rectangle QR codes.
Declaration
Swift
public static let defaultBackdrop: EFStyleParamBackdrop
-
The default color for random rectangles (green).
Declaration
Swift
public static let defaultColor: CGColor
-
Creates random rectangle QR code styling parameters.
Declaration
Swift
public init( icon: EFStyleParamIcon? = nil, backdrop: EFStyleParamBackdrop = EFStyleRandomRectangleParams.defaultBackdrop, color: CGColor = EFStyleRandomRectangleParams.defaultColor )
Parameters
icon
The icon to display in the center of the QR code. Defaults to nil.
backdrop
The backdrop configuration. Defaults to default backdrop.
color
The base color for random rectangles. Defaults to green.