summaryrefslogtreecommitdiff
path: root/tikzit/src/common/Preambles.m
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2012-04-18 13:45:43 +0100
committerAlex Merry <alex.merry@cs.ox.ac.uk>2012-04-18 13:45:43 +0100
commit2f6a98730f6af18a71b31c72468042f3b5b81915 (patch)
tree63dc3ece2a7ca80be03f5c32add0edc3d9693ce0 /tikzit/src/common/Preambles.m
parentb9c39efd55a5dd03a52e0ac3da191fed763f53db (diff)
Add edge colours
Diffstat (limited to 'tikzit/src/common/Preambles.m')
-rw-r--r--tikzit/src/common/Preambles.m11
1 files changed, 9 insertions, 2 deletions
diff --git a/tikzit/src/common/Preambles.m b/tikzit/src/common/Preambles.m
index d41f9b0..e107d5e 100644
--- a/tikzit/src/common/Preambles.m
+++ b/tikzit/src/common/Preambles.m
@@ -23,6 +23,7 @@
#import "Preambles.h"
#import "NodeStyle.h"
+#import "EdgeStyle.h"
static NSString *PREAMBLE_HEAD =
@"\\documentclass{article}\n"
@@ -112,15 +113,21 @@ static NSString *POSTAMBLE =
[fill hexName], [fill redFloat], [fill greenFloat], [fill blueFloat]];
}
- if ([fill name] == nil && ![colors containsObject:fill]) {
+ if ([stroke name] == nil && ![colors containsObject:stroke]) {
[colors addObject:stroke];
[colbuf appendFormat:@"\\definecolor{%@}{rgb}{%.3f,%.3f,%.3f}\n",
- [fill hexName], [fill redFloat], [fill greenFloat], [fill blueFloat]];
+ [stroke hexName], [stroke redFloat], [stroke greenFloat], [stroke blueFloat]];
}
}
[buf appendString:@"\n"];
for (EdgeStyle *st in [styleManager edgeStyles]) {
[buf appendFormat:@"%@\n", [st tikz]];
+ ColorRGB *color = [st colorRGB];
+ if ([color name] == nil && ![colors containsObject:color]) {
+ [colors addObject:color];
+ [colbuf appendFormat:@"\\definecolor{%@}{rgb}{%.3f,%.3f,%.3f}\n",
+ [color hexName], [color redFloat], [color greenFloat], [color blueFloat]];
+ }
}
NSString *defs = [[NSString alloc] initWithFormat:@"%@\n%@", colbuf, buf];