a69240a9bac4235c633835bf07465061c192b75c1d9a6ebfc9b6d000ac8b0c01bcdc6531c2bc625610ab1c544274b4aa61dcaf8b59842ce10e5034d3cc1a19 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Take input from [0, n] and return it as [0, 1]
  3. * @hidden
  4. */
  5. export declare function bound01(n: any, max: number): number;
  6. /**
  7. * Force a number between 0 and 1
  8. * @hidden
  9. */
  10. export declare function clamp01(val: number): number;
  11. /**
  12. * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  13. * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  14. * @hidden
  15. */
  16. export declare function isOnePointZero(n: string | number): boolean;
  17. /**
  18. * Check to see if string passed in is a percentage
  19. * @hidden
  20. */
  21. export declare function isPercentage(n: string | number): boolean;
  22. /**
  23. * Return a valid alpha value [0,1] with all invalid values being set to 1
  24. * @hidden
  25. */
  26. export declare function boundAlpha(a?: number | string): number;
  27. /**
  28. * Replace a decimal with it's percentage value
  29. * @hidden
  30. */
  31. export declare function convertToPercentage(n: number | string): number | string;
  32. /**
  33. * Force a hex value to have 2 characters
  34. * @hidden
  35. */
  36. export declare function pad2(c: string): string;