SketchUp C API

- Main Page
- Related Pages
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Fields | Related Functions
SUColor Struct Reference

Stores a RGBA color with 8 bit channels. More...

`#include <SketchUpAPI/color.h>`

## Data Fields
SUByte | red
| Red color channel.
SUByte | green
| Green color channel.
SUByte | blue
| Blue color channel.
SUByte | alpha
| Alpha color channel.

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUColorBlend (const SUColor color1, const SUColor color2, const double weight, SUColor *blended_color)
| The blend method is used to blend two colors. The blended color will be the result of taking (1 - weight) * sucolor1 + weight * sucolor2. More...
enum SUResult | SUColorGetNumNames (size_t *size)
| Retrieves the number of color names recognized by SketchUp. More...
enum SUResult | SUColorGetNames (SUStringRef names[], const size_t size)
| Retrives all the color names recognized by SketchUp. More...
enum SUResult | SUColorSetByName (SUColor *color, const char *name)
| Sets the color represented by the name. More...
enum SUResult | SUColorSetByValue (SUColor *color, const size_t value)
| Sets the color with the provided value. The passed in value can either be integer or hexadecimal. Alpha will always be 255 but RGB. For example: if the value is 0x66ccff, rgb will be (102, 204, 255) respectively. More...

## Detailed Description

Stores a RGBA color with 8 bit channels.

## Friends And Related Function Documentation

enum SUResult SUColorBlend | ( | const SUColor | color1,
|  | const SUColor | color2,
|  | const double | weight,
|  | SUColor * | blended_color
| ) |  |
| related

The blend method is used to blend two colors. The blended color will be the result of taking (1 - weight) * sucolor1 + weight * sucolor2.

Since
  SketchUp 2018, API 6.0

Parameters

  [in] | color1 | A SUColor to blend color2 with.
  [in] | color2 | A SUColor to blend color1 with.
  [in] | weight | A value that determines the weight
  [out] | blended_color | The blended SUColor.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_OUT_OF_RANGE if weight is out of range
  - SU_ERROR_NULL_POINTER_OUTPUT if blended_color is NULL

enum SUResult SUColorGetNames | ( | SUStringRef | names[],
|  | const size_t | size
| ) |  |
| related

Retrives all the color names recognized by SketchUp.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | names | An array of all the SketchUp Color names.
  [in] | size | The size of the array.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if names is NULL

enum SUResult SUColorGetNumNames | ( | size_t * | size | ) |
| related

Retrieves the number of color names recognized by SketchUp.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | size | The number of color names.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if size is NULL

enum SUResult SUColorSetByName | ( | SUColor * | color,
|  | const char * | name
| ) |  |
| related

Sets the color represented by the name.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | color | The struct representing the color.
  [in] | name | The string representing the color.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
  - SU_ERROR_INVALID_ARGUMENT if name is empty

enum SUResult SUColorSetByValue | ( | SUColor * | color,
|  | const size_t | value
| ) |  |
| related

Sets the color with the provided value. The passed in value can either be integer or hexadecimal. Alpha will always be 255 but RGB. For example: if the value is 0x66ccff, rgb will be (102, 204, 255) respectively.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | color | The struct representing the color.
  [in] | value | A value that represents the color.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL

The documentation for this struct was generated from the following file:

- SketchUpAPI/color.h