@zendeskgarden/react-theming
Version:
Theming utilities and components within the Garden Design System
25 lines (22 loc) • 466 B
JavaScript
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
import { getColor } from './getColor.js';
const getHueColor = ({
theme,
value
}) => {
const pattern = /^[a-z]+\.[a-z]+$/giu;
const options = pattern.test(value) ? {
variable: value,
theme
} : {
hue: value,
theme
};
return getColor(options);
};
export { getHueColor };