任意のNSColorの色名称を948色のテーブルから取得するオープンソースの「DBColorNames」(By Daniel Beard)をフレームワーク化したdbColNamesKitを呼び出して色の詳細な名称を取得するAppleScriptです。


–> Download Framework Binary


– Created 2018-01-11 by Takaaki Naganoya
– 2018 Piyomaru Software
use AppleScript version “2.4″
use scripting additions
use framework “Foundation”
use framework “AppKit”
use framework “dbColNamesKit” –https://github.com/daniel-beard/DBColorNames/

property NSColor : a reference to current application’s NSColor

set {rVal, gVal, bVal} to choose color
set aColor to makeNSColorFromRGBAval(rVal, gVal, bVal, 65535, 65535) of me
set aCDB to current application’s DBColorNames’s alloc()’s init()

set aColorStr to (aCDB’s nameForColor:aColor) as string

on makeNSColorFromRGBAval(redValue as integer, greenValue as integer, blueValue as integer, alphaValue as integer, aMaxVal as integer)
  set aRedCocoa to (redValue / aMaxVal) as real
set aGreenCocoa to (greenValue / aMaxVal) as real
set aBlueCocoa to (blueValue / aMaxVal) as real
set aAlphaCocoa to (alphaValue / aMaxVal) as real
set aColor to NSColor’s colorWithCalibratedRed:aRedCocoa green:aGreenCocoa blue:aBlueCocoa alpha:aAlphaCocoa
return aColor
end makeNSColorFromRGBAval

★Click Here to Open This Script 

Leave a Reply