Cocoa Internals/Graphics

From Lazarus wiki
Revision as of 17:04, 1 January 2018 by Skalogryz (talk | contribs) (Created page with "==Colors== Cocoa-WS should be using device-dependent colors to match colors across other widgetsets. That applies to color of Pen, Brush and Font :The “Device” color-s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Colors

Cocoa-WS should be using device-dependent colors to match colors across other widgetsets.

That applies to color of Pen, Brush and Font


The “Device” color-space names represent color spaces in which component values are applied to devices as specified. There is no optimization or adjustment for differences between devices in how they render colors. If you know exactly which device is connected to a system and you want to print or display a certain color on that device, then it makes sense to use a appropriate device-dependent color space when creating NSColor objects. However, it is usually not the case that an application knows which devices are connected and their specific color spaces. If you specify components of a color in a device-dependent color space—let’s say NSDeviceRGBColorSpace—and then have several displays render this color, you will see several slightly different colors.
To get around this problem you can use calibrated color spaces, which are designated by two of the color-space names in Table 1. A calibrated color space is a device-independent color space. The color spaces designated by NSCalibratedWhiteColorSpace and NSCalibratedRGBColorSpace color spaces are calibrated to a device that best represents devices in a particular class, such as color displays. It allows your application to present reasonably accurate colors when you are unsure about the color space of a device in a particular context.

See Also