Convert CMYK to RGB before serializing

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38423 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2015-03-22 21:41:56 +00:00
parent cb8e9ca4d7
commit 56f365b1a0
2 changed files with 13 additions and 21 deletions

View file

@ -1,3 +1,8 @@
2015-03-22 Riccardo Mottola <rm@gnu.org>
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
Convert CMYK to RGB before serializing.
2015-03-22 Riccardo Mottola <rm@gnu.org>
* Modules/Editors/ProjectCenter/PCEditor.m

View file

@ -243,7 +243,6 @@
- (void)setEditorColor:(id)sender
{
NSColor *color;
NSColor *currentColor;
NSString *colorString;
NSString *key;
NSString *colorSpaceName;
@ -252,50 +251,38 @@
{
NSLog(@"foregroundColorWell");
color = [foregroundColorWell color];
currentColor = currentForegroundColor;
key = EditorForegroundColor;
}
else if (sender == backgroundColorWell)
{
NSLog(@"backgroundColorWell");
color = [backgroundColorWell color];
currentColor = currentBackgroundColor;
key = EditorBackgroundColor;
}
else // selectionColorWell
{
NSLog(@"selectionColorWell");
color = [selectionColorWell color];
currentColor = currentSelectionColor;
key = EditorSelectionColor;
}
colorSpaceName = [color colorSpaceName];
NSLog(@"Color's colorspace name: '%@'", colorSpaceName);
if ([colorSpaceName isEqualToString:@"NSCalibratedRGBColorSpace"])
{
/* [sender setColor:currentColor];
NSRunAlertPanel(@"Set Color",
@"Please, use RGB color.\n"
@"Color in color well left unchanged",
@"Close", nil, nil);*/
colorString = [NSString stringWithFormat:@"RGB %0.1f %0.1f %0.1f",
[color redComponent],
[color greenComponent],
[color blueComponent]];
}
else if ([colorSpaceName isEqualToString:@"NSCalibratedWhiteColorSpace"])
if ([colorSpaceName isEqualToString:@"NSCalibratedWhiteColorSpace"])
{
colorString = [NSString stringWithFormat:@"White %0.1f",
[color whiteComponent]];
}
else
{
return;
if (![colorSpaceName isEqualToString:NSCalibratedRGBColorSpace])
color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
colorString = [NSString stringWithFormat:@"RGB %0.1f %0.1f %0.1f",
[color redComponent],
[color greenComponent],
[color blueComponent]];
}
currentColor = color;
NSLog(@"Selected color: '%@'", colorString);
[prefs setString:colorString forKey:key notify:YES];