color () value

From PenguinMod Wiki (Official)
Color () value
Jump to navigation Jump to search

The color () value block is a reporter block in the Color Picker extension that reports the hex (default selected option), red, green, or blue value as a dropdown. The default hex value is #9966ff, which is the default paint editor purple in Scratch 3.0 and PenguinMod without using addons.

Workaround

The red, green, and blue options can be worked around by converting the hex to rgb, and then getting the r, g, or b portions:
get [r] from (hex (color (hex v) value::#ff7db5) to rgb::#ff4c4c)::extension reporter
For green and blue, r would be changed to g and b, respectively.
Hex can also be worked around by converting the rgb values to hex, using the JSON format that the rgb () to hex block uses.

define color picker hex
set [hex] to (rgb (join [{"r": ] (color (red v) value::#ff7db5) [, "g": ] (color (green v) value::#ff7db5) [, "b": ] (color (blue v) value::#ff7db5) [}]::operators) to hex::#ff4c4c)::#0869c2
return (get [hex]::#0869c2)::custom cap
ve Color Picker Extension Blocks Navigation
PenguinMod Blocks show color picker  · set picker position to x: () y: ()  · set picker color to ()  · color () value  · picker () position  · when color changed