@@ -718,31 +718,33 @@ function setupSensorsBlocks(activity) {
718718 * @returns {number } - The argument value representing the color.
719719 */
720720 arg ( logo , turtle ) {
721- const wasVisible = activity . turtles . turtleList [ turtle ] . container . visible ;
722- activity . turtles . turtleList [ turtle ] . container . visible = false ;
723- const x = activity . turtles . turtleList [ turtle ] . container . x ;
724- const y = activity . turtles . turtleList [ turtle ] . container . y ;
725- activity . refreshCanvas ( ) ;
726-
727- const canvas = docById ( "overlayCanvas" ) ;
728- const ctx = canvas . getContext ( "2d" ) ;
729- const imgData = ctx . getImageData ( Math . floor ( x ) , Math . floor ( y ) , 1 , 1 ) . data ;
730- let color = searchColors ( imgData [ 0 ] , imgData [ 1 ] , imgData [ 2 ] ) ;
731-
732- if ( imgData [ 3 ] === 0 ) {
733- color = platformColor . background
734- . substring (
735- platformColor . background . indexOf ( "(" ) + 1 ,
736- platformColor . background . lastIndexOf ( ")" )
737- )
738- . split ( / , \s * / ) ;
739- color = searchColors ( color [ 0 ] , color [ 1 ] , color [ 2 ] ) ;
740- }
741-
742- if ( wasVisible ) {
743- activity . turtles . turtleList [ turtle ] . container . visible = true ;
744- }
745- return color ;
721+ // const wasVisible = activity.turtles.turtleList[turtle].container.visible;
722+ // activity.turtles.turtleList[turtle].container.visible = false;
723+ // const x = activity.turtles.turtleList[turtle].container.x;
724+ // const y = activity.turtles.turtleList[turtle].container.y;
725+ // activity.refreshCanvas();
726+
727+ // const canvas = docById("overlayCanvas");
728+ // const ctx = canvas.getContext("2d");
729+ // const imgData = ctx.getImageData(Math.floor(x), Math.floor(y), 1, 1).data;
730+ // let color = searchColors(imgData[0], imgData[1], imgData[2]);
731+
732+ // if (imgData[3] === 0) {
733+ // color = platformColor.background
734+ // .substring(
735+ // platformColor.background.indexOf("(") + 1,
736+ // platformColor.background.lastIndexOf(")")
737+ // )
738+ // .split(/,\s*/);
739+ // color = searchColors(color[0], color[1], color[2]);
740+ // }
741+
742+ // if (wasVisible) {
743+ // activity.turtles.turtleList[turtle].container.visible = true;
744+ // }
745+ // return color;
746+
747+ console . log ( logo . p5 . hello ( ) ) ;
746748 }
747749 }
748750
0 commit comments