Browse Source

lowercase rgba_to_string res for hex

v1.x
Tj Holowaychuk 14 years ago
parent
commit
f4cd85ad05
  1. 2
      src/color.cc
  2. 5
      test/canvas.test.js

2
src/color.cc

@ -242,7 +242,7 @@ rgba_create(uint32_t rgba) {
void
rgba_to_string(rgba_t rgba, char *buf) {
if (1 == rgba.a) {
sprintf(buf, "#%.2X%.2X%.2X"
sprintf(buf, "#%.2x%.2x%.2x"
, (int) (rgba.r * 255)
, (int) (rgba.g * 255)
, (int) (rgba.b * 255));

5
test/canvas.test.js

@ -92,7 +92,10 @@ module.exports = {
assert.equal('#80c880', ctx[prop], prop + ' rgba(128, 200, 128, 1) -> #80c880, got ' + ctx[prop]);
ctx[prop] = 'rgba(128,80,0,0.5)';
assert.equal('rgba(128, 80, 0, 0.5)', ctx[prop], prop + ' rgba(128,80,0,0.5) -> rgba(128, 80, 0, 0.5), got ' + ctx[prop]);
assert.equal('rgba(128, 80, 0, 0.50)', ctx[prop], prop + ' rgba(128,80,0,0.5) -> rgba(128, 80, 0, 0.5), got ' + ctx[prop]);
ctx[prop] = 'rgba(128,80,0,0.75)';
assert.equal('rgba(128, 80, 0, 0.75)', ctx[prop], prop + ' rgba(128,80,0,0.75) -> rgba(128, 80, 0, 0.75), got ' + ctx[prop]);
if ('shadowColor' == prop) return;

Loading…
Cancel
Save