<svg viewbox='0 0 100 100'>
    <defs>
        <filter id='color-replace' color-interpolation-filters='sRGB'>
            <!-- One rectangle has fill #3D348B, which is RGB(61,52,139). -->
            <!-- We'll replace it with  #3D958B -->
            <feComponentTransfer>
                <!-- 61 -->
                <feFuncR type='discrete' tableValues='0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 1 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0'/>
                <!-- 52 -->
                <feFuncG type='discrete' tableValues='0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 1 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0'/>
                <!-- 139 -->
                <feFuncB type='discrete' tableValues='0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 1
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0 0 0 0 0
                                                      0 0 0 0 0 0'/>
            </feComponentTransfer>
            <feColorMatrix type='matrix' values='1 0 0 0 0
                                                 0 1 0 0 0
                                                 0 0 1 0 0
                                                 1 1 1 1 -3' result='selectedColor'/>
            <feFlood flood-color='#3D958B'/>
            <feComposite operator='in' in2='selectedColor'/>
            <feComposite operator='over' in2='SourceGraphic'/>
        </filter>
    </defs>
    <g filter='url(#color-replace)'>
        <rect x='10' y='0'  width='70' height='70' fill='#7678ED'/>
        <!-- This rectangle V V V -->
        <rect x='50' y='50' width='50' height='50' fill='#3D348B'/>
        <rect x='0'  y='20' width='30' height='30' fill='#F7B801'/>
        <rect x='60' y='30' width='10' height='10' fill='#F7B801'/>
        <rect x='70' y='70' width='10' height='10' fill='#F7B801'/>
    </g>
</svg>
svg {
    display: block;
    height: 90vmin;
    width: 90vmin;
    margin: 5vmin auto;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.