MCPcopy Create free account
hub / github.com/apitable/apitable / getFieldOptionColor

Function getFieldOptionColor

packages/core/src/model/color.ts:52–61  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

50 * @param index option.color
51 */
52export function getFieldOptionColor(index: number) {
53 const hue = COLOR_INDEX_NAME[index % COLOR_INDEX_NAME.length]!;
54 const level = Math.floor(index / COLOR_INDEX_NAME.length);
55 const baseColorValue = COLOR_MAP[hue];
56 const value = getColorValue(baseColorValue, COLOR_LEVEL_ALPHA[level]!);
57 return {
58 name: `${hue}_${level}`,
59 value,
60 };
61}
62
63/**
64 * get all color name array, index is color number

Callers 8

apiMetaPropertyMethod · 0.90
cellValueToOpenValueMethod · 0.90
apiMetaPropertyFunction · 0.90
openFieldPropertyFunction · 0.90
cellValueToOpenValueMethod · 0.90
getSelectOptionsFunction · 0.90

Calls 1

getColorValueFunction · 0.85

Tested by

no test coverage detected