EFStyle25DParams
public class EFStyle25DParams : EFStyleParams
Parameters for 2.5D QR code styling.
This class defines the styling parameters for 2.5D QR codes, which create a three-dimensional appearance using shading and depth effects. The 2.5D style simulates depth by using different colors for the top, left, and right faces of each module.
## Features
- Three-dimensional appearance with depth simulation
- Customizable height for data and position modules
- Multi-color shading (top, left, right faces)
- Icon and backdrop support
- Realistic 3D visual effect
## Usage
let params = EFStyle25DParams(
icon: icon,
backdrop: backdrop,
dataHeight: 1.0,
positionHeight: 1.0,
topColor: .black,
leftColor: .darkGray,
rightColor: .lightGray
)
let style = EFQRCodeStyle.style25D(params)
## Visual Characteristics
- Modules appear to have depth and volume
- Different colors create shading effects
- Height parameters control the 3D appearance
- Creates a modern, sophisticated look
-
The default backdrop configuration for 2.5D QR codes.
Declaration
Swift
public static let defaultBackdrop: EFStyleParamBackdrop
-
The default color for the top face of modules (black).
Declaration
Swift
public static let defaultTopColor: CGColor
-
The default color for the left face of modules (semi-transparent black).
Declaration
Swift
public static let defaultLeftColor: CGColor
-
The default color for the right face of modules (semi-transparent black).
Declaration
Swift
public static let defaultRightColor: CGColor
-
Creates 2.5D QR code styling parameters.
Declaration
Swift
public init( icon: EFStyleParamIcon? = nil, backdrop: EFStyleParamBackdrop = EFStyle25DParams.defaultBackdrop, dataHeight: CGFloat = 1, positionHeight: CGFloat = 1, topColor: CGColor = EFStyle25DParams.defaultTopColor, leftColor: CGColor = EFStyle25DParams.defaultLeftColor, rightColor: CGColor = EFStyle25DParams.defaultRightColor )
Parameters
icon
The icon to display in the center of the QR code. Defaults to nil.
backdrop
The backdrop configuration. Defaults to default backdrop.
dataHeight
The height of data modules for 3D effect. Defaults to 1.0.
positionHeight
The height of position detection patterns for 3D effect. Defaults to 1.0.
topColor
The color of the top face of modules. Defaults to black.
leftColor
The color of the left face of modules. Defaults to semi-transparent black.
rightColor
The color of the right face of modules. Defaults to semi-transparent black.