mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
This commit is contained in:
@@ -600,6 +600,16 @@ Blockly.isNumber = function(str) {
|
||||
return /^\s*-?\d+(\.\d+)?\s*$/.test(str);
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert a hue (HSV model) into an RGB hex triplet.
|
||||
* @param {number} hue Hue on a colour wheel (0-360).
|
||||
* @return {string} RGB code, e.g. '#5ba65b'.
|
||||
*/
|
||||
Blockly.hueToHex = function(hue) {
|
||||
return Blockly.utils.colour.hsvToHex(hue, Blockly.HSV_SATURATION,
|
||||
Blockly.HSV_VALUE * 255);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks old colour constants are not overwritten by the host application.
|
||||
* If a constant is overwritten, it prints a console warning directing the
|
||||
|
||||
Reference in New Issue
Block a user