Quantcast
Channel: Jason Andrews Blog
Viewing all articles
Browse latest Browse all 33813

RE: Defining waveform thicknesses and colors on a white background in VIVA

$
0
0
I put them both in the same file and defined them in a similar fashion: /* abColorNameToHex.il Author A.D.Beckett Group Custom IC (UK), Cadence Design Systems Ltd. Language SKILL Date Jul 02, 2018 Modified Jul 10, 2018 By A.D.Beckett Convert friendly color (or colour!) names to RGB hex strings as suitable for passing to awvPlotWaveform. Invalid color names result in string when gets handled as black (or white) when plotting in ViVA. abColorNameToHex("pink") => "0xffc0cb" abColorNameToHex(list("yellow" "purple" "lightgreen")) => ("0xffff00" "0xa020f0" "0x90ee90") Also provides abDisplayColorToHex which first looks for color names in the display.drf and if not found, uses abColorNameToHex. This also supports both a single color and a list of colors. Uses SKILL++ methods just to avoid having a case statement! *************************************************** SCCS Info: @(#) abColorNameToHex.il 07/10/18.17:25:52 1.2 */ ( defmethod abColorNameToHex ((colorName string)) ( strcat "0x" ( buildString ( mapcar ( lambda (intensity) ( sprintf nil "%02x" ( round ( times intensity 0.255)))) (nameToColor colorName) ) "" ))) ( defmethod abColorNameToHex ((colorNames list )) ( mapcar 'abColorNameToHex colorNames) ) ( defmethod abDisplayColorToHex ((colorName string) @optional (display "display" )) ( let (color) ( setq color ( drGetColor display colorName)) ( if color ( sprintf nil "0x%02x%02x%02x" ( nth 2 color) ( nth 3 color) ( nth 4 color)) (abColorNameToHex colorName) ) ) ) ( defmethod abDisplayColorToHex ((colorNames list ) @optional (display "display" )) ( mapcar lambda ((colorName) (abDisplayColorToHex colorName display)) colorNames) )

Viewing all articles
Browse latest Browse all 33813

Trending Articles