@gpa-gemstone/helper-functions
Version:
Helper Functions for gpa-gemstone packages
17 lines (16 loc) • 544 B
TypeScript
/**
* Converts RGB hex code to a HSV color. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSV_color_space.
* code from https://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c.
* Assumes color in hex code.
* returns h, s, and v that are contained in the set [0, 1].
*
* @param Number h Hex Code (format of #123456 or 123456 digits)
* @returns String Spaced color in hex code.
*/
declare function HexToHsv(hex: string): {
h: number;
s: number;
v: number;
};
export { HexToHsv };