Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon Request: Fashion #2801

Closed
WebReflection opened this issue Jan 26, 2014 · 2 comments
Closed

Icon Request: Fashion #2801

WebReflection opened this issue Jan 26, 2014 · 2 comments

Comments

@WebReflection
Copy link

there is really nothing that could be related to a fashion category, as clothes, sun glasses, simply a shirt, anything that could lead a user to think about such category … please make it happen, thanks a lot!

P.S. this is a function to draw a shirt, in case it helps you speeding this up.

function fashionIcon(canvas, size, fillColor, backgroundColor) {
  var
    originalSize = 64,
    ratio = size / originalSize,
    fillStyle = fillColor || '#286868',
    context = canvas.getContext('2d')
  ;
  function arc(a, b, c, d, e) {
    context.arc(
      a * ratio,
      b * ratio,
      c * ratio,
      d,
      e
    );
  }
  function bezierCurveTo(a, b, c, d, e, f) {
    context.bezierCurveTo(
      a * ratio,
      b * ratio,
      c * ratio,
      d * ratio,
      e * ratio,
      f * ratio
    );
  }
  function moveTo(x, y) {
    context.moveTo(x * ratio, y * ratio);
  }
  function lineTo(x, y) {
    context.lineTo(x * ratio, y * ratio);
  }
  context.clearRect(0, 0, canvas.width, canvas.height);
  canvas.width = canvas.height = size;
  if (backgroundColor) {
    context.fillStyle = backgroundColor;
    context.fillRect(0, 0, size, size);
  }
  context.fillStyle = fillStyle;
  context.save();
  context.beginPath();
  moveTo(18, 12);
  lineTo(26, 10);
  bezierCurveTo(30, 16, 34, 16, 38, 10);
  lineTo(48, 12);
  lineTo(58, 20);
  lineTo(52, 28);
  lineTo(46, 24);
  lineTo(46, 54);
  lineTo(18, 54);
  lineTo(18, 24);
  lineTo(12, 28);
  lineTo(6, 20);
  lineTo(18, 12);
  context.closePath();
  context.fill();
  context.restore();
  return canvas;
}

// example about:blank
// copy in console above function then … 
fashionIcon(
  document.body.appendChild(
    document.createElement('canvas')
  ),
  256,     // size in pixels
  '#069',  // color
  '#EEE'  // background, will be transparent otherwise
);
@tagliala
Copy link
Member

t-shirt is a dup of #715 , please +1 that request
sunglasses is a dup of #13 , please +1 that request
clothes is a dup of #2238, please +1 that request

all dups, closing here

@WebReflection
Copy link
Author

uhm, I kinda suspected that … feel free to use the shape above function drawing if you like it though. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants