Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing function Blockly.hueToRgb #6175

Closed
charlesgetup opened this issue May 25, 2022 · 0 comments · Fixed by #6533
Closed

missing function Blockly.hueToRgb #6175

charlesgetup opened this issue May 25, 2022 · 0 comments · Fixed by #6533
Assignees
Labels
component: devtools help wanted External contributions actively solicited issue: bug Describes why the code or behaviour is wrong

Comments

@charlesgetup
Copy link

Describe the bug

In demos/blockfactory/block_definition_extractor.js, line 719, Blockly.hueToRgb function is not defined. And this makes base block in block factory main workspace disappear after a manual JSON change.

To Reproduce

Steps to reproduce the behavior:

  1. Open the demo block factory and change the block type in base block, e.g. I changed it to "test";
  2. Change the Block Definition format to "Manual JSON..." and make a change, e.g. I changed colour hue from 230 to 200;
  3. Switch the Block Definition format back to "JSON", the changes stays in preview workspace, but the base block in main workspace is gone.

Expected behavior

After making a manual JSON code change, the base block in main workspace should still be there.

Screenshots

Screenshots are uploaded in Blockly Groups.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.4 LTS
  • Browser chrome
  • Version 101.0.4951.64 (Official Build) (64-bit)

Additional context

I have figured out a fix.

Replace line 718 - 720 in demos/blockfactory/block_definition_extractor.js with the following code.

var colourHex = Blockly.utils.colour.hsvToHex(hue, Blockly.HSV_SATURATION, 255 * Blockly.HSV_VALUE);
colourBlock.append(BlockDefinitionExtractor.newDomElement_('mutation', {
    colour: colourHex
}));
@charlesgetup charlesgetup added the issue: triage Issues awaiting triage by a Blockly team member label May 25, 2022
@BeksOmega BeksOmega added issue: bug Describes why the code or behaviour is wrong component: devtools help wanted External contributions actively solicited and removed issue: triage Issues awaiting triage by a Blockly team member labels May 27, 2022
@BeksOmega BeksOmega added this to the Bug Bash Backlog milestone May 27, 2022
@maribethb maribethb self-assigned this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: devtools help wanted External contributions actively solicited issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants