ReplaceColor
class ReplaceColor extends EffectQualifier
Maps an input color and those similar to the input color to corresponding shades of a specified output color, taking luminosity and chroma into account, in order to recolor objects in your image in a natural way.
More highly saturated input colors usually give the best results. It is recommended to avoid input colors approaching white, black, or gray.
Learn more: Replace colors example
Methods
                    __construct(string|ColorValue $toColor, int $tolerance = null, string|ColorValue $fromColor = null)
        
                                            
                            ReplaceColor constructor.
                    toColor(string|ColorValue $to)
        
                                            
                            Sets the target output color.
                    tolerance(int $tolerance)
        
                                            
                            Sets the tolerance threshold.
                    fromColor(string|ColorValue $fromColor)
        
                                            
                            Sets the base input color to map.
Details
                                    
    __construct(string|ColorValue $toColor, int $tolerance = null, string|ColorValue $fromColor = null)
        
    
    ReplaceColor constructor.
                                    ReplaceColor
    toColor(string|ColorValue $to)
        
    
    Sets the target output color.
                                    ReplaceColor
    tolerance(int $tolerance)
        
    
    Sets the tolerance threshold.
                                    ReplaceColor
    fromColor(string|ColorValue $fromColor)
        
    
    Sets the base input color to map.