Use custom lightness shades for specific colors
mainBy default, the Slider uses the lightness prop to determine the value levels of the color blocks. However, you can use customColorShades to provide specialized lightness arrays for specific colors (e.g., different scales for black vs. white).
When the current color matches a color defined in customColorShades (based on HSVA values within a tolerance), the component switches to that specific lightness array.
Note: Matching is performed using HSVA values with a tolerance of 2 units.
<Slider
color="#000000"
customColorShades={[
{
color: '#000000',
lightness: [50, 40, 30, 20, 10]
},
{
color: '#ffffff',
lightness: [95, 90, 80, 70, 60]
}
]}
lightness={[80, 65, 50, 35, 20]} // Fallback lightness
/>