12 第1页 | 共2 页下一页
返回列表 发新帖
查看: 4634|回复: 13
打印 上一主题 下一主题

[Anark] HSV Colors (Script Utilities Behavior)

[复制链接]
Asen    

867

主题

0

听众

1万

积分

外协人员

Rank: 7Rank: 7Rank: 7

纳金币
17488
精华
1
跳转到指定楼层
楼主
发表于 2011-10-21 08:22:00 |只看该作者 |倒序浏览






               HSV Colors (Script Utilities Behavior)
              









           Summary
         

           Extends all Color objects to support hue/saturation/value properties.
         





               Category
              


              Latest Behaviors
            




               Author
              


              Gavin Kistner
            




               Difficulty
              


              (Reference)
            




               Time to Complete
              


              5 Minutes
            








           Downloads
         


            Click Here
           
           to download the associated files.
         


            (This document covers version 1.0 of the 'HSV Colors' behavior, current as of 2005-Feb-11)
           

            Description
           


             This utility library extends Color objects to support
            
              .h
            
             ,
            
              .s
            
             , and
            
              .v
            
             properties for
            
              HSV
            
             (Hue, Saturation, Value) manipulations.
            

             Hue values are specified and returned as numbers in the range 0..360, with pure red being 0, pure green 120, and pure blue 240.
            

             Saturation and Value values are specified and returned as numbers in the range 0..100.
            

             To use, simply attach this behavior anywhere in the scene. (You have to actually attach it to add the functionality; loading it into the library for the project is not enough.)
            
            Example code:
            
             //Set the material to a dark red color
myMaterial.diffuse = new Color( 150, 0, 0 );

var theColor = myMaterial.diffuse;
alert(theColor.h+', '+theColor.h+', '+theColor.v);
//alerts "0, 0, 58.82352941176471"

theColor.h = 120;
//theColor is now 0, 150, 0

theColor.h = 30;
//theColor is now 150, 75, 0

theColor.v = 100
//theColor is now 255, 128, 0

theColor.s = 50;
//theColor is now 255 192 128
            

             Note that changes to the hue or saturation do not take effect when the value is exactly 0, and changes to the hue will not take effect when the saturation is 0.
            


            Demonstration
           




              View Demonstration Project
            




              Download Project File
            



分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2012-3-13 23:19:53 |只看该作者
水……生命之源……灌……
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

板凳
发表于 2012-3-23 23:20:55 |只看该作者
不错 非常经典  实用
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

地板
发表于 2012-3-25 23:26:22 |只看该作者
爱咋咋地!
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

5#
发表于 2012-4-5 23:33:03 |只看该作者
水。。。
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-4-11 23:21:36 |只看该作者
先顶上去,偶要高亮加精鸟!
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

7#
发表于 2012-8-22 00:13:45 |只看该作者
非常感谢,管理员设置了需要对新回复进行审核,您的帖子通过审核后将被显示出来,现在将转入主题
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

8#
发表于 2012-9-1 01:05:54 |只看该作者
无聊时可以刷屏幕 灌水 也可以试试 帖子的标题究竟可以写多长
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

9#
发表于 2012-9-4 23:18:58 |只看该作者
好铁多多发,感激分享
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

10#
发表于 2012-10-18 23:26:01 |只看该作者
好`我顶``顶顶
回复

使用道具 举报

12 第1页 | 共2 页下一页
返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-5-9 19:46 , Processed in 0.082176 second(s), 28 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部