mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Move Blockly.hueToRgb to Blockly.utils.colour
Also adds support for ‘#f00’, ‘rgb(255, 0, 0)’ and ‘red’ for block colours, in addition to ‘#ff0000’ (and of course hue).
This commit is contained in:
@@ -57,8 +57,6 @@ goog.require('Blockly.inject');
|
||||
goog.require('Blockly.utils');
|
||||
goog.require('Blockly.Xml');
|
||||
|
||||
goog.require('goog.color');
|
||||
|
||||
|
||||
// Turn off debugging when compiled.
|
||||
// Unused within the Blockly library, but used in Closure.
|
||||
@@ -121,16 +119,6 @@ Blockly.cache3dSupported_ = null;
|
||||
*/
|
||||
Blockly.theme_ = null;
|
||||
|
||||
/**
|
||||
* 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.hueToRgb = function(hue) {
|
||||
return goog.color.hsvToHex(hue, Blockly.HSV_SATURATION,
|
||||
Blockly.HSV_VALUE * 255);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the dimensions of the specified SVG image.
|
||||
* @param {!Element} svg SVG image.
|
||||
|
||||
Reference in New Issue
Block a user