.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "pods::SDL::Color 3pm" .TH pods::SDL::Color 3pm 2024-01-10 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME SDL::Color \- Format independent color description .SS CATEGORY .IX Subsection "CATEGORY" Core, Video, Structure .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 8 \& my $black = SDL::Color\->new(0, 0, 0); \& my $color = SDL::Color\->new(255, 0, 0); \& my $r = $color\->r; # 255 \& my $g = $color\->g; # 0 \& my $b = $color\->b; # 0 \& $color\->g(255); \& $color\->b(255); \& # $color is now white .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`SDL_Color\*(C'\fR describes a color in a format independent way. .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" .Vb 1 \& my $color = SDL::Color\->new(255, 0, 0); .Ve .PP The constructor creates a new color with the specified red, green and blue values. .SS r .IX Subsection "r" .Vb 2 \& my $r = $color\->r; \& $color\->r(128); .Ve .PP If passed a value, this method sets the red component of the color; if not, it returns the red component of the color. .SS g .IX Subsection "g" .Vb 2 \& my $g = $color\->g; \& $color\->g(128); .Ve .PP If passed a value, this method sets the green component of the color; if not, it returns the green component of the color. .SS b .IX Subsection "b" .Vb 2 \& my $b = $color\->b; \& $color\->b(128); .Ve .PP If passed a value, this method sets the blue component of the color; if not, it returns the blue component of the color. .SH "SEE ALSO" .IX Header "SEE ALSO" SDL::Surface .SH AUTHORS .IX Header "AUTHORS" See "AUTHORS" in SDL.