PHP Classes

File: rgb.class.txt

Recommend this page to a friend!
  Classes of Luis Quijada Serrano   RGB / CSS Color Process   rgb.class.txt   Download  
File: rgb.class.txt
Role: Documentation
Content type: text/plain
Description: Package Main Documentation: rgb.class.php
Class: RGB / CSS Color Process
Performs RGB / CSS Color converting and processing
Author: By
Last change: short changes in functionality
Date: 21 years ago
Size: 3,528 bytes
 

Contents

Class file image Download
AUTOR / AUTHOR : LUIS QUIJADA SERRANO FECHA / DATE : 7/03/2002. VERSION : 1.0 PACKAGE : RGB / CSSColor process. COMMENTS : A class package to process RGB triplets and CSS colors. CLASSES : RGB (rgb.class.php file : RGB_Esp (rgb_esp.class.php file) (included) : RGB_Eng (rgb_eng.class.php file) (included) CONSTRUCTOR : RGB(RGB_EN); IF YOU WANT ENGLISH METHODS (see methods at class RGB_Eng ) CONSTRUCTOR : RGB(RGB_ES); IF YOU WANT SPANISH METHODS / SI QUIERES MÉTODOS EN ESPAÑOL EXAMPLES : Yes, English and Spanish, see at rgb_esp.class.txt (spanish expamples) and rgb_eng.class.txt (for english usage examples) FUNCTIONALITY : - Perform basics RGB operations over CSS colors or RGB triplets. - It converts CSS valid colors (#aabbcc) onto character separated RGB triplet string, like (255,125,200) or array [0]=>255,[1]=>125,[2]=>200. And, of course, RGB char separated string or array onto valid CSS color. - Extract and manipulate rgb components. - Light up, darken and saturate colors. [EN] REMARKS OVER METHODS, ARGUMENTS & RETURN VALUES - RGB values on RGB triplets vary from 0 to 255 instead of 0-FF. - A valid CSS color for this class to process is #RRGGBB format, where magnitude vary from 0 to FF (hexadecimal). - values returned by method are the same type like input argument or value to transform. In other way, all methods thas manipulate RGB triplets (well at a string or array) return RGB value, y so on with CSS colors. Input RGB values or triplets (and consecuently) the output RGB values can enter or exit in two manners: - String way, RGB components are separated each other by the value specified by $cseparator. ej: "245,34,23" (in case of using ',' for $cseparator. - 1 Dimension, 3 cells, Array way. * [0] = RED component. * [1] = GREEN component. * [2] = BLUE component. - For methods thas use $component argument, the values for that argument are restricted and defined, the values are: * RGB_R : for processing RED component. * RGB_G : for processing GREEN component. * RGB_B : for processing BLUE component. [ES] GENERALIDADES SOBRE LOS MÉTODOS, ARGUMENTOS Y VALORES DE RETORNO - Los métodos devuelven el mismo tipo de valor que el valor del argumento de entrada o valor a procesar. Es decir que todas los métodos que procesan valores RGB devuelven valores RGB, y así para los colores CSS. Los valores RGB de entrada (y consecuentemente) de salida pueden tener dos formatos: - En forma de cadena, en la cual los componentes RGB están separados unos de otros por el valor indicado en el argumento $cseparador, ej: "245,34,23" (si hubieramos utilizado ',' como $cseparador. - En forma de array o matriz de 1 una dimensión y tres celdas. * [0] = componente ROJO. * [1] = componente VERDE. * [2] = componente AZUL. - Para los métodos que utilicen el argumento $componente (aquellas que que tengan que ver con un componente determinado), el valor de dicha variable ha de ser alguna de las constantes ('defines') * RGB_R : para procesar el componente ROJO. * RGB_G : para procesar el componente VERDE. * RGB_B : para procesar el componente AZUL.