Rebol [ title: "Capsules and sockets style" ] do load-thru site/utils/extend-img.r get-socket: func [ base-color facets /local size zero-color col-moif pixels img-bin pix bin i ][ if none? base-color [ base-color: system/view/vid/vid-face/color ] dpt-modif: max 1 either find facets 'depth [5 - facets/depth][1] zero-color: 160 bin: read-thru either find facets 'source [ facets/source ][ site/imgz/sockets/caps-1.bin] i: index? find bin ";" size: load to-string copy/part bin i col-modif: skip bin i pixels: size/x * size/y img-bin: make binary! 3 * pixels for p 1 pixels 1 [ modif: (col-modif/:p - zero-color) / dpt-modif if find facets 'invert [modif: 0 - modif] pix: either modif < 0 [ base-color - (1.1.1 * (abs modif)) ][ base-color + (1.1.1 * modif)] append img-bin head reverse to-binary pix ] make image! reduce [size img-bin] ] capsules: stylize [ capsule: box with [ color: none font: make font [size: 11 color: 0.0.0 shadow: 0x0 valign: 'middle align: 'center] ; para: make para [origin: 0x5] init: [ image: extend-img either none? image [ load-thru/binary site/imgz/capsules/caps-0.gif ][ image ] size facets if none? size [size: 100x12] size: image/size effect: [key 0.0.0] ;black is always the transparent color! ] ] socket: box with [ init: [ image: extend-img (get-socket color facets) size facets ] ] ]