查看: 1023|回复: 5

问个关于颜色的问题

  [复制链接]
头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-9-7
回帖
3
发表于 2008-9-15 21:25:01 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

孤独守望

梦石
0
星屑
3144
在线时间
1535 小时
注册时间
2006-10-16
回帖
4223

开拓者贵宾

发表于 2008-9-15 21:26:34 | 显示全部楼层
Window_Base
  1.   def text_color(n)
  2.     case n
  3.     when 0
  4.       return Color.new(255, 255, 255, 255)
  5.     when 1
  6.       return Color.new(128, 128, 255, 255)
  7.     when 2
  8.       return Color.new(255, 128, 128, 255)
  9.     when 3
  10.       return Color.new(128, 255, 128, 255)
  11.     when 4
  12.       return Color.new(128, 255, 255, 255)
  13.     when 5
  14.       return Color.new(255, 128, 255, 255)
  15.     when 6
  16.       return Color.new(255, 255, 128, 255)
  17.     when 7
  18.       return Color.new(192, 192, 192, 255)
  19.     else
  20.       normal_color
  21.     end
  22.   end
复制代码

改一下when 0的内容
和
  1.   #--------------------------------------------------------------------------
  2.   # ● 获取普通文字色
  3.   #--------------------------------------------------------------------------
  4.   def normal_color
  5.     return Color.new(255,255 ,255, 255)
  6.   end
复制代码
的内容,
颜色定义方法是:R,G,B,alpha
菩提本非树,明镜本非台。回头自望路漫漫。不求姻缘,但求再见。
本来无一物,何处惹尘埃。风打浪吹雨不来。荒庭遍野,扶摇难接。
不知道多久更新一次的博客
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-9-7
回帖
3
 楼主| 发表于 2008-9-15 23:01:55 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

孤独守望

梦石
0
星屑
3144
在线时间
1535 小时
注册时间
2006-10-16
回帖
4223

开拓者贵宾

发表于 2008-9-15 23:08:05 | 显示全部楼层
normal_color也改掉。
菩提本非树,明镜本非台。回头自望路漫漫。不求姻缘,但求再见。
本来无一物,何处惹尘埃。风打浪吹雨不来。荒庭遍野,扶摇难接。
不知道多久更新一次的博客
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-9-7
回帖
3
 楼主| 发表于 2008-9-15 23:17:15 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
50
在线时间
3 小时
注册时间
2007-6-8
回帖
386
发表于 2008-9-16 00:15:39 | 显示全部楼层
def text_color(n)
    case n
    when 0
      return Color.new(255, 255, 255, 255)
    when 1
      return Color.new(128, 128, 255, 255)
    when 2
      return Color.new(255, 128, 128, 255)
    when 3
      return Color.new(128, 255, 128, 255)
    when 4
      return Color.new(128, 255, 255, 255)
    when 5
      return Color.new(255, 128, 255, 255)
    when 6
      return Color.new(255, 255, 128, 255)
    when 7
      return Color.new(192, 192, 192, 255)
    else
      normal_color
    end
  end
改when 0
return Color.new(255, 255, 255, 255)
里面前三个数字
囧...总算是有图片菜单了, 我不是X党!!!强烈抗议!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部