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

Method getChannelRange

packages/react-stately/src/color/Color.ts:745–757  ·  view source on GitHub ↗
(channel: ColorChannel)

Source from the content-addressed store, hash-verified

743 }
744
745 getChannelRange(channel: ColorChannel): ColorChannelRange {
746 switch (channel) {
747 case 'hue':
748 return {minValue: 0, maxValue: 360, step: 1, pageSize: 15};
749 case 'saturation':
750 case 'lightness':
751 return {minValue: 0, maxValue: 100, step: 1, pageSize: 10};
752 case 'alpha':
753 return {minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1};
754 default:
755 throw new Error('Unknown color channel: ' + channel);
756 }
757 }
758
759 getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions {
760 switch (channel) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected