dpb56083 2010-11-29 13:21
浏览 51
已采纳

基于刻度淡入十六进制颜色

How do you fade in a hex colour? based on a scale of 0 - 100.

Say I want an element to be green when awarded 100, and white when 0, with all the shades in between.

Update: HEX>RGB>HSV - Helpful collection of routines here: http://php.amnuts.com/index.php?do=view&id=16&file=class.image.php

  • 写回答

3条回答 默认 最新

  • dongxian6741 2010-11-29 13:26
    关注

    You should use the HSV colour coordinates, and let the hue (H) and value (V) be fixed, and vary the saturation (S) from none (gray, 0) to full (green, 1). It is easy to convert between RGB and HSV. You can use the formulae from Wikipedia.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 前端echarts坐标轴问题
  • ¥15 CMFCPropertyPage
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码
  • ¥50 silvaco GaN HEMT有栅极场板的击穿电压仿真问题
  • ¥15 谁会P4语言啊,我想请教一下
  • ¥15 这个怎么改成直流激励源给加热电阻提供5a电流呀
  • ¥50 求解vmware的网络模式问题 别拿AI回答