3-digit hexadecimal color defintions act like CSS (e.g., #FFF is #FFFFFF now, not #F0F0F0).

This commit is contained in:
William Kendrick 2006-09-11 08:25:24 +00:00
parent 114087af21
commit d30e67594e
4 changed files with 26 additions and 15 deletions

View file

@ -7,12 +7,12 @@
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/tuxpaint/
# June 14, 2002 - July 11, 2006
# June 14, 2002 - September 10, 2006
# The version number, for release:
VER_VERSION=0.9.16
VER_VERSION=0.9.16rc1
VER_DATE=`date +"%Y-%m-%d"`

View file

@ -327,10 +327,8 @@ Windows Users
color model" article.)
Colors may be listed using three decimal numbers (e.g.,
"255 64 128") or a 6- or 3-digit-long hexadecimal 'triplet'
(e.g., "#ff4080" or "#F48"). Note: You must separate decimal
values with spaces, and begin hexadecimal values with a
pound/number-sign character ("#").
"255 68 136") or a 6- or 3-digit-long hexadecimal 'triplet'
(e.g., "#ff4488" or "#F48").
After the color definition (on the same line) you may enter text
to describe the color. Tux will display this text when the color
@ -339,6 +337,12 @@ Windows Users
As an example, you can see the default colors currently used in
Tux Paint in: "default_colors.txt".
NOTES: You must separate decimal values with spaces, and begin
hexadecimal values with a pound/number-sign character ("#"). In
3-digit hexadecimal, each digit is used for both the high and
low halves of the byte, so "#FFF" is the same as "#FFFFFF", not
"#F0F0F0".
lang=LANGUAGE
Run Tux Paint in one of the supported languages. Possible choice

View file

@ -403,12 +403,9 @@ New Breed Software</p>
article.)</p>
<p>Colors may be listed using three decimal numbers (e.g.,
"<code>255&nbsp;64&nbsp;128</code>") or a 6- or 3-digit-long hexadecimal
'triplet' (e.g., "<code>#ff4080</code>" or "<code>#F48</code>").
Note: You must separate decimal values with spaces, and begin
hexadecimal values with a pound/number-sign character
("<code>#</code>").</p>
"<code>255&nbsp;68&nbsp;136</code>") or a 6- or 3-digit-long hexadecimal
'triplet' (e.g., "<code>#ff4488</code>" or "<code>#F48</code>").</p>
<p>After the color definition (on the same line) you may enter text to
describe the color. Tux will display this text when the color is
clicked. (For example,
@ -417,6 +414,13 @@ New Breed Software</p>
<p>As an example, you can see the default colors currently
used in Tux&nbsp;Paint in:
"<a href="default_colors.txt"><code>default_colors.txt</code></a>".</p>
<p>NOTES: You must separate decimal values with spaces, and begin
hexadecimal values with a pound/number-sign character
("<code>#</code>"). In 3-digit hexadecimal, each digit is used for
both the high and low halves of the byte, so
"<code>#FFF</code>" is the same as "<code>#FFFFFF</code>", not
"<code>#F0F0F0</code>".</p>
</dd>
<dt><code><b>lang=<i>LANGUAGE</i></b></code></dt>

View file

@ -6528,9 +6528,12 @@ static void setup(int argc, char *argv[])
{
/* Nybble (#rgb) form */
color_hexes[NUM_COLORS][0] = (hex2dec(tmp_str[0]) << 4);;
color_hexes[NUM_COLORS][1] = (hex2dec(tmp_str[1]) << 4);;
color_hexes[NUM_COLORS][2] = (hex2dec(tmp_str[2]) << 4);;
color_hexes[NUM_COLORS][0] =
(hex2dec(tmp_str[0]) << 4) + hex2dec(tmp_str[0]);
color_hexes[NUM_COLORS][1] =
(hex2dec(tmp_str[1]) << 4) + hex2dec(tmp_str[1]);
color_hexes[NUM_COLORS][2] =
(hex2dec(tmp_str[2]) << 4) + hex2dec(tmp_str[2]);
color_names[NUM_COLORS] = strdup(str + count);
NUM_COLORS++;