Adobe 23102480 Scripting Guide - Page 51
Solid Color Classes, Using Hex Values for RGB Color, Getting and Converting Colors
UPC - 883919080222
View all Adobe 23102480 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 51 highlights
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 VBS 'create a solidColor array Dim solidColorRef Set solidColorRef = CreateObject("Photoshop.SolidColor") solidColorRef.CMYK.Cyan = 20 solidColorRef.CMYK.Magenta = 90 solidColorRef.CMYK.Yellow = 50 solidColorRef.CMYK.Black = 50 appRef.ForegroundColor = solidColorRef JS //create a solid color array var solidColorRef = new solidColor() solidColorRef.cmyk.cyan = 20 solidColorRef.cmyk.magenta = 90 solidColorRef.cmyk.yellow = 50 solidColorRef.cmyk.black = 50 foregroundColor = solidColorRef Solid Color Classes The solid color classes available in Photoshop CS3 are illustrated below. Scripting Photoshop CS3 51 Color Classes Solid Color RGB Color CMYK Color Gray Color HSB Color Lab Color No Color Using Hex Values for RGB Color You can express RGB colors as hex (or hexadecimal) values. A hex value contains three pairs of numbers which represent red, blue and green (in that order). In AppleScript, the hex value is represented by the hex value string property in class RGB hex color, and you use the convert color command described below to retrieve the hex value. In VBScript and JavaScript, the RGBColor object has a string property called HexValue/hexValue. Getting and Converting Colors The following examples convert an RGB color to its CMYK equivalent.