Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Gráficos (https://www.clubdelphi.com/foros/forumdisplay.php?f=8)
-   -   Cambiar color del formulario (https://www.clubdelphi.com/foros/showthread.php?t=58460)

MAXIUM 21-07-2008 17:07:05

Cambiar color del formulario
 
Hola, quisiera saber como cambiar el color de mi formulario en formato RGB hexadecimal tipo #FF55FF ya que solo puedo usar los colores preestablecidos del tipo clRed. Uso Delphi 7, pero tambien sería bueno saber como usarlo en Delphi 6.

eduarcol 21-07-2008 17:12:39

igual como lo tienes pero le agregas dos ceros luego del numeral:

#00


perdón hay que sustituir el # por el $

felipe88 21-07-2008 17:21:21

Cita:

Empezado por eduarcol (Mensaje 301908)
igual como lo tienes pero le agregas dos ceros luego del numeral:

#00


perdón hay que sustituir el # por el $

Debo decir Gracias por ese aporte ;)

MAXIUM 21-07-2008 17:48:08

mmm... tonces esos 2 últimos digitos deben corresponder al canal Alpha. Muchas gracias.

coso 21-07-2008 17:55:50

Hola maxium, no corresponden al canal alpha (al menos en delphi5). Te dejo aqui la ayuda

Cita:

Color is used to specify the color of an object.

Unit

Graphics

type TColor = -(COLOR_ENDCOLORS + 1)..$02FFFFFF;

Description

TColor is used to specify the color of an object. It is used by the Color property of many components and by a number of other properties that specify color values.

The Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces).

If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.

If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.


The following table lists the color constants from the Graphics unit. The first two columns list the colors that map to the closest matching color in the system palette, while the last two columns list the colors that are defined in the Windows Control panel.
saludos

FGarcia 21-07-2008 23:53:10

¿y esto no vale?

Código Delphi [-]
{Declarando en el evento OnCreate del formulario
  Form.color := RGB(rrr,ggg,bbb);}
 
Form.color := RGB(120,180,65);

MAXIUM 22-07-2008 03:34:08

Ven, siempre se aprenden cosas.

FGarcia 03-08-2008 18:02:13

1 Archivos Adjunto(s)
Hace ya tiempo que tenia esto, le hice unos retoques y se puede mejorar, espero comentarios y aportes.


La franja horaria es GMT +2. Ahora son las 17:55:05.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi