Classes


Last modified: 2013-3-2

Class RGBAColor

Canvas-Api for Max (can be found in MAX_PATH/Cycling '74/jsextensions/)

Defined in: CanvasExtension.js

Class Summary
Constructor Attributes Constructor Name and Description
 
RGBAColor(color_string, globalAlpha)
The following code is based on an example from Stoyan Stefanov .
Field Summary
Field Attributes Field Name and Description
Number 0-255 
a
alpha
Number 0-255 
b
blue
Number 0-255 
g
green
Boolean 
ok
color value ok?
Number 0-255 
r
red
<private> <inner> RGBAColor.simple_colors 
Not visible from outside
Method Summary
Method Attributes Method Name and Description
String 
toHex()
Converts a RGB value to hexadecimal value
String 
toRGB()
returns its RGB value.
Class Detail

RGBAColor

(color_string, globalAlpha)
The following code is based on an example from Stoyan Stefanov . Added supported for alpha channel.

Defined in: CanvasExtension.js
Author: Silvio Haedrich for c74, 6th of july 2010.
Example:
// non working example
// array of color definition objects
var color_defs = [
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
example: ['hsl(123, 34, 100)', 'hsl(25,23%,25%)'],
example: ['#00ff00', '336699'],
example: ['#fb0', 'f0f'],
example: ['rgb(123, 234, 45, 0.1)', 'rgb(255,234,245,0.5)'],
example: ['hsla(123, 34, 100, 0.798)', 'hsla(25,23%,25%,0.8)'],
example: ['#00ff00dd', '336699ee'],
example: ['#fb04', 'f0fa'],
];
Parameters:
{String} color_string
Color in different formats.
  • rgb(123, 234, 45)
  • hsl(123, 34, 100)
  • #00ff00
  • #fb0
  • rgb(123, 234, 45, 0.1)
  • hsla(123, 34, 100, 0.798)
  • #00ff00dd
  • #fb04
globalAlpha
 
Field Detail
{Number 0-255}

a

alpha

{Number 0-255}

b

blue

{Number 0-255}

g

green

{Boolean}

ok

color value ok?

{Number 0-255}

r

red

<private> <inner> {RGBAColor.simple_colors}

simple_colors

Not visible from outside
Method Detail
{String}

toHex

()
Converts a RGB value to hexadecimal value
Example:
//TODO
Returns:
{String} hexadecimal value like #FFFFFF

{String}

toRGB

()
returns its RGB value.
Example:
//TODO
Returns:
{String} RGB value like rgb(Float, Float, Float)

©2012-2013
Max MSP Documentation copied to JsDoc by Tim Schenk SEO Frelancer Berlin. Some examples are by him. Some descriptions of classes, interfaces, properties, methods or events are by him. Until now, most of it is a copy. Published with permission of Cycling '74. This document might be wrong or incomplete. All informations without any warranty. All trademarks are the property of their respective owners. Documentation generated by JsDoc Toolkit on 2013-3-2