MCPcopy Create free account
hub / github.com/adobe/react-spectrum / ColorSpaceControl

Function ColorSpaceControl

packages/dev/s2-docs/src/VisualExampleClient.tsx:1403–1426  ·  view source on GitHub ↗
({control, value})

Source from the content-addressed store, hash-verified

1401}
1402
1403function ColorSpaceControl({control, value}) {
1404 let {setProps} = useContext(Context);
1405 return (
1406 <UnionControl
1407 control={{
1408 ...control,
1409 optional: false
1410 }}
1411 value={value}
1412 onChange={colorSpace => {
1413 setProps(props => {
1414 props = {...props, colorSpace};
1415 if (props.channel) {
1416 props.channel = getColorChannels(colorSpace)[0];
1417 }
1418
1419 delete props.xChannel;
1420 delete props.yChannel;
1421 return props;
1422 });
1423 }}
1424 />
1425 );
1426}
1427
1428function PlacementControl({control, value, onChange}) {
1429 return (

Callers

nothing calls this directly

Calls 1

getColorChannelsFunction · 0.90

Tested by

no test coverage detected