Rev 18641 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18641 | Rev 18642 | ||
---|---|---|---|
Line 1031... | Line 1031... | ||
1031 | case COLORPALETTE: |
1031 | case COLORPALETTE: |
1032 | /* |
1032 | /* |
1033 | @ colorpalette color_name_1,color_name_2,...,color_name_8 |
1033 | @ colorpalette color_name_1,color_name_2,...,color_name_8 |
1034 | @ opacity will be the same for all colors and is set by command <a href="#opacity">opacity [0-255],[0-255]</a> |
1034 | @ opacity will be the same for all colors and is set by command <a href="#opacity">opacity [0-255],[0-255]</a> |
1035 | @ can be used with command <a href='#userdraw'>userdraw clickfill,color</a> when more than one fillcolor is wanted.<br>in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br>the pupil can choose from the given colors by clicking small coloured buttons.<br> the click coordinates and corresponding fillcolor will be stored in read_canvas()...when using the appropriate replyformat.<br>the first color of the palette is color=0 |
1035 | @ can be used with command <a href='#userdraw'>userdraw clickfill,color</a> when more than one fillcolor is wanted.<br>in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br>the pupil can choose from the given colors by clicking small coloured buttons.<br> the click coordinates and corresponding fillcolor will be stored in read_canvas()...when using the appropriate replyformat.<br>the first color of the palette is color=0 |
1036 | @ make sure to include the ''remove button`` by using command <a href='#clearbutton'>clearbutton some_text</a> |
1036 | @ make sure to include the ''remove button`` by using command <a href='#clearbutton'>clearbutton some_text</a><br/>please note: right mouse click will alse remove last added item... |
- | 1037 | @%colorpalette%size 400,400%xrange -10,10%yrange -10,10%linewidth 3%circles blue,0,0,4,1,1,6,3,3,3,-3,-3,5%opacity 255,100%colorpalette red,green,yellow,blue%userdraw clickfill,green%clearbutton REMOVE |
|
1037 | */ |
1038 | */ |
1038 | if( use_tooltip == 1 ){canvas_error("command 'colorpalette' is incompatible with command 'intooltip tip_text'");} |
1039 | if( use_tooltip == 1 ){canvas_error("command 'colorpalette' is incompatible with command 'intooltip tip_text'");} |
1039 | fprintf(js_include_file,"var multifillcolors = [];var palettecolors = ["); |
1040 | fprintf(js_include_file,"var multifillcolors = [];var palettecolors = ["); |
1040 | while( ! done ){ |
1041 | while( ! done ){ |
1041 | temp = get_color(infile,1); |
1042 | temp = get_color(infile,1); |
1042 | fprintf(js_include_file,"\" |
1043 | fprintf(js_include_file,"\"%s,%d\",",temp,(int) (255*fill_opacity)); |
1043 | } |
1044 | } |
1044 | fprintf(js_include_file,"];");/* add black to avoid trouble with dangling comma... */ |
1045 | fprintf(js_include_file,"];");/* add black to avoid trouble with dangling comma... */ |
1045 | add_color_palette(css_class); |
1046 | add_color_palette(css_class); |
1046 | break; |
1047 | break; |
1047 | 1048 |