(color)
| 409 | } |
| 410 | |
| 411 | function parseColor(color) { |
| 412 | return { |
| 413 | r: parseInt(color.substr(2, 2), 16), |
| 414 | g: parseInt(color.substr(4, 2), 16), |
| 415 | b: parseInt(color.substr(6, 2), 16) |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | const PARSE_COLOR = `def ${Blockly.Python.FUNCTION_NAME_PLACEHOLDER_}(color): |
| 420 | return {'r': int(color[1:3], 16), 'g': int(color[3:5], 16), 'b': int(color[5:7], 16)}`; |