Colors
COLOR HELPERS
NO_DIALOG = DialogModes.DisplayNoDialogs
module-attribute
CONVERTING COLOR
add_color_to_gradient(action_list, color, location, midpoint)
@param action_list: Action list to add this color to. @param color: SolidColor object @param location: Location of the color along the track. @param midpoint: Percentage midpoint between this color and the next.
Source code in src/helpers/colors.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
apply_cmyk(action, c, color_type='color')
Apply CMYK SolidColor object to action descriptor. @param action: ActionDescriptor object. @param c: SolidColor object matching CMYK model. @param color_type: Color action descriptor type, defaults to 'color'.
Source code in src/helpers/colors.py
212 213 214 215 216 217 218 219 |
|
apply_cmyk_from_list(action, color, color_type='color')
Applies CMYK color to action descriptor from a list of values. @param action: ActionDescriptor object. @param color: List of integers for R, G, B. @param color_type: Color action descriptor type, defaults to 'color'.
Source code in src/helpers/colors.py
187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
apply_color(action, color, color_type='color')
Applies color to the specified action descriptor. @param action: ActionDescriptor object. @param color: RGB/CMYK SolidColor object, or list of RGB/CMYK values. @param color_type: Color action descriptor type, defaults to 'color'.
Source code in src/helpers/colors.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
apply_rgb(action, c, color_type='color')
Apply RGB SolidColor object to action descriptor. @param action: ActionDescriptor object. @param c: SolidColor object matching RGB model. @param color_type: Color action descriptor type, defaults to 'color'.
Source code in src/helpers/colors.py
202 203 204 205 206 207 208 209 |
|
apply_rgb_from_list(action, color, color_type='color')
Applies RGB color to action descriptor from a list of values. @param action: ActionDescriptor object. @param color: List of integers for R, G, B. @param color_type: Color action descriptor type, defaults to 'color'.
Source code in src/helpers/colors.py
173 174 175 176 177 178 179 180 181 182 183 184 |
|
fill_layer_primary()
Fill active layer using foreground color.
Source code in src/helpers/colors.py
264 265 266 267 268 |
|
get_cmyk(c, m, y, k)
Creates a SolidColor object with the given CMYK values. @param c: Float from 0.0 to 100.0 for Cyan component. @param m: Float from 0.0 to 100.0 for Magenta component. @param y: Float from 0.0 to 100.0 for Yellow component. @param k: Float from 0.0 to 100.0 for black component. @return: SolidColor object.
Source code in src/helpers/colors.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_color(color)
Automatically get either cmyk or rgb color given a range of @param color: Array containing 3 (RGB) or 4 (CMYK) numbers between 0 and 255, or the name of a known color. @return: SolidColor object.
Source code in src/helpers/colors.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
get_pinline_gradient(colors, color_map=None, location_map=None)
Return a gradient color list notation for some given pinline colors. @param colors: Pinline colors to produce a gradient. @param color_map: Color map to color the pinlines. @param location_map: Location map to position gradients. @return: Gradient color list notation.
Source code in src/helpers/colors.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
|
get_rgb(r, g, b)
Creates a SolidColor object with the given RGB values. @param r: Integer from 0 to 255 for red spectrum. @param g: Integer from 0 to 255 for green spectrum. @param b: Integer from 0 to 255 for blue spectrum. @return: SolidColor object.
Source code in src/helpers/colors.py
68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
get_rgb_from_hex(hex_code)
Creates an RGB SolidColor object with the given hex value. Allows prepending # or without. @param hex_code: Hexadecimal color code. @return: SolidColor object.
Source code in src/helpers/colors.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
get_text_layer_color(layer)
Occasionally, Photoshop has issues with retrieving the color of a text layer. This helper guards against errors and null values by defaulting to rgb_black() in the event of a problem. @param layer: Layer object that must be TextLayer @return: SolidColor object representing the color of the text item.
Source code in src/helpers/colors.py
154 155 156 157 158 159 160 161 162 163 164 165 |
|
hex_to_rgb(color)
Convert a hexadecimal color code into RGB value list. @param color: Hexadecimal color code, e.g. #F5D676 @return: Color in RGB list notation.
Source code in src/helpers/colors.py
28 29 30 31 32 33 34 35 36 |
|
rgb_black()
Creates a black SolidColor object. @return: SolidColor object.
Source code in src/helpers/colors.py
44 45 46 47 48 49 |
|
rgb_grey()
Creates a grey SolidColor object. @return: SolidColor object.
Source code in src/helpers/colors.py
52 53 54 55 56 57 |
|
rgb_white()
Creates a white SolidColor object. @return: SolidColor object.
Source code in src/helpers/colors.py
60 61 62 63 64 65 |
|