Skip to content

How to Reduce or Attenuate Feedback Colors in AWS FaceLivenessDetector?

0

Hello, I am implementing the @aws-amplify/ui-react-liveness (FaceLivenessDetector) component in my web application, and I have a requirement to reduce or attenuate the intensity of the feedback colors (green, red, blue, etc.) shown to users during the liveness process. I have already tried the following:

Adjusting the config overlay and oval colors to be fully transparent or very soft.

Applying CSS filters (brightness, saturate, grayscale, etc.) directly to the canvas element.

Using a MutationObserver to re-apply styles whenever the canvas is recreated.

Even editing styles directly in the node_modules directory.

Unfortunately, none of these approaches work. The feedback colors rendered by the AWS SDK remain unchanged, which can be uncomfortable for some users.

My question:

Is there any supported or documented way to attenuate or customize the intensity of the feedback colors in the liveness video stream?

Is there an “accessibility mode” or a way to make the feedback less visually intense, or to apply a global style/filter to the video?

If not, is this behavior intentional for security reasons, and is there an official statement or workaround for users sensitive to bright colors?

Any guidance or confirmation from the AWS team would be greatly appreciated. Thank you!

asked a year ago210 views

1 Answer
-1

You can customize the FaceLivenessDetector component's appearance using the ThemeProvider in Amplify UI for React. To modify the colors and create a less intense visual experience, you would need to wrap the FaceLivenessDetector in a ThemeProvider and define a custom theme.

Here's how you can approach this:

  1. Wrap your FaceLivenessDetector in a ThemeProvider
  2. Create a theme object with customized colors
  3. Apply this theme to attenuate the intensity of the feedback colors

For example:

import React from 'react';
import { FaceLivenessDetector } from '@aws-amplify/ui-react-liveness';
import { Theme, ThemeProvider, useTheme } from '@aws-amplify/ui-react';

export function CustomizedLivenessDetector() {
const [showLiveness, setShowLiveness] = React.useState(false);
const { tokens } = useTheme();

React.useEffect(() => {
setShowLiveness(true);
}, []);

const theme = {
name: 'Attenuated Face Liveness Theme',
tokens: {
colors: {
brand: {
primary: {
// Use more muted colors here
'10': { /* muted color value */ },
'80': { /* muted color value */ },
'90': { /* muted color value */ },
'100': { /* muted color value */ },
},
},
// Other color customizations
},
},
};

return (
<ThemeProvider theme={theme}>
{showLiveness && (
<FaceLivenessDetector
sessionId={'sessionId'}
region={'us-east-1'}
onAnalysisComplete={async () => {}}
/>
)}
</ThemeProvider>
);
}

It's worth noting that there may be limitations to how much you can customize the feedback colors, as some aspects of the liveness detection process might have specific color requirements for security and accuracy reasons. The documentation suggests that certain modifications are discouraged as they can affect the security and accuracy of the Face Liveness check.

If you're specifically concerned about accessibility for users sensitive to bright colors, you might want to consider providing an alternative option or warning before initiating the liveness check.
Sources
Customization | Amplify UI for React
Colors | Amplify UI for React

answered a year ago

  • Thanks again for the suggestions. I have already implemented an accessibility warning to inform users about the visual feedback during the liveness check.

    However, I would still like to know if there are any other technical approaches or workarounds (even if they're not officially supported) that could help attenuate or reduce the intensity of the feedback colors rendered by the AWS Liveness SDK on the live video—beyond the ThemeProvider or CSS filters.

    If anyone has found a custom solution, browser setting, accessibility tool, or any creative method that helps make the color feedback less intense for sensitive users (even partially), I would really appreciate any guidance, examples, or experiences.

    Thank you in advance!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.