image
image copied to clipboard
Change letterbox color
Images with fit="contain" get a black letterbox which I would like to change.
<nuxt-img src="/sample.png" height="40" width="125" fit="contain" />
Is it possible to change the letterbox color from black to something else?
I also require this feature in order to be able to use contain
It seems to work with the modifier 'b' with IPX as provider.
eg: <nuxt-img src="/sample.png" height="40" width="125" fit="contain" :modifiers="{ b: '#FFFFFF' }" />
I found it in the github ipx repo
I think that it's linked to this source code:
const operationsGenerator = createOperationsGenerator({
keyMap: {
format: 'f',
fit: 'fit',
width: 'w',
height: 'h',
resize: 's',
quality: 'q',
background: 'b'
},
joinWith: ',',
formatter: (key, val) => encodeParam(key) + '_' + encodeParam(val)
})