Exemplo n.º 1
0
/*
  Returns an array containing all the shape's colors.
*/
VALUE Shape_getColors(VALUE self)
{
   Shape &ref = getRef<Shape>(self);
   int size = ref.getColorsNumber();

   VALUE ret = rb_ary_new();
   OSL_COLOR *col = ref.getColors();

   for (int i = 0; i < size; ++i)
      rb_ary_push(ret, col2hash(col[i]));
   return ret;
}
Exemplo n.º 2
0
/*
  Return the shape's first color.
*/
VALUE Shape_getColor(VALUE self)
{
   Shape &ref = getRef<Shape>(self);
   return col2hash(ref.getColor());
}
Exemplo n.º 3
0
/*
  Returns the title's color.
*/
VALUE MsgConfig_titleColor(VALUE self)
{
   MsgConfig &ref = getRef<MsgConfig>(self);
   return col2hash(ref.titleColor);
}
Exemplo n.º 4
0
/*
  Returns the border's color.
*/
VALUE MsgConfig_borderColor(VALUE self)
{
   MsgConfig &ref = getRef<MsgConfig>(self);
   return col2hash(ref.borderColor);
}
Exemplo n.º 5
0
/*
  call-seq: [x, y]

  Returns the color of a pixel.
*/
VALUE Buffer_getPixel(VALUE self, VALUE x, VALUE y) {
   Buffer &ref = getRef<Buffer>(self);
   return col2hash(ref.getPixel(FIX2INT(x), FIX2INT(y)));
}