Skip Menu |

This queue is for tickets about the Graph-Easy CPAN distribution.

Report information
The Basics
Id: 98398
Status: new
Priority: 0/
Queue: Graph-Easy

Owner: Nobody in particular
Requestors: Andy.Baumhauer [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Patch to handle color lists
Date: Thu, 28 Aug 2014 19:48:06 +0000
To: "bug-Graph-Easy [...]" <bug-Graph-Easy [...]>
From: "Baumhauer, Andy" <Andy.Baumhauer [...]>
Download (untitled) / with headers
text/plain 2.4k
Here is a patch to handle colorlists in GraphViz In Graph::Easy::Attributes sub _color { # Check that a given color name (like 'red'), or value (like '#ff0000') # or rgb(1,2,3) is valid. Used by valid_attribute(). # Note that for color names, the color scheme is not known here, so we # can only look if the color name is potentially possible. F.i. under # the Brewer scheme ylorrd9, '1' is a valid color name, while 'red' # would not. To resolve such conflicts, we will fallback to 'x11' # (the largest of the schemes) if the color name doesn't exist in # the current scheme. # Handle new colorlists -- colors separated by : my ($self, $org_color) = @_; $org_color = lc($org_color); # color names are case insensitive $org_color =~ s/\s//g; # remove spaces to unify format my $rc = 1; # Return code if the colors are ok foreach my $color ( split(':', $org_color) ) { if ($color =~ s/^(w3c|[a-z]+\d{0,2})\///) { my $scheme = $1; next if (exists $color_names->{$scheme}->{$color}); # if it didn't work, then fall back to x11 $scheme = 'x11'; next if (exists $color_names->{$scheme}->{$color}); } # scheme unknown, fall back to generic handling # red => red next if (exists $all_color_names->{$color}); # #ff0000 => #ff0000, rgb(1,2,3) => rgb(1,2,3) next if (defined $self->color_as_hex($color)); $rc = 0; # We couldn't find a matching color in any scheme } return $rc ? $org_color : undef; } Andrew Baumhauer | Network Architect | Interactive Data Corporation * 600 W. Fulton Street, Suite 700, Chicago, IL 60661 * 312-802-2110 | 6 312-277-6590 Fax | *<> ******************************************************* This message (including any files transmitted with it) may contain confidential and/or proprietary information, is the property of Interactive Data Corporation and/or its subsidiaries, and is directed only to the addressee(s). If you are not the designated recipient or have reason to believe you received this message in error, please delete this message from your system and notify the sender immediately. An unintended recipient's disclosure, copying, distribution, or use of this message or any attachments is prohibited and may be unlawful. *******************************************************
Download (untitled) / with headers
text/html 11.9k

Message body is not shown because it is too large.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to